Angry Birds - A Platformer                              #games

Instructions: Help Red Bird get the eggs back from the pigs!\n\n< < < How to Play > > >\n<> WASD or Arrow Keys to move!\n<> Run against a wall and hold jump to wall jump!

@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (level)\nend\n\nwhen flag clicked\nforever\n    play sound [main_theme v] until done\nend\n\n@Player\n\nwhen flag clicked\nset [air time v] to [0]\nset [max level v] to [1]\nset [level v] to [1]\nRespawn [-200] [-100]\nforever\n    switch costume to (hitbox v)\n    change [air time v] by (1)\n    if <(air time) > [100]> then\n        set [air time v] to [100]\n    end\n    change [y speed v] by (-2)\n    Change Y (y speed)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(touching ground) = [1]>> then\n        set [y speed v] to [20]\n        start sound [Seagulls2 v]\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (90)\n        change [x speed v] by (2)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n        change [x speed v] by (-2)\n    end\n    if <(x speed) > [8]> then\n        set [x speed v] to [8]\n    else\n        if <(x speed) < [-8]> then\n            set [x speed v] to [-8]\n        end\n    end\n    Change X (x speed)\n    if <(x speed) > [0]> then\n        change [x speed v] by (-1)\n    else\n        if <(x speed) < [0]> then\n            change [x speed v] by (1)\n        end\n    end\n    if <<(x position) > [239]> and <not <(level) = [16]>>> then\n        if <not <(level) = (max level)>> then\n            Respawn [-210] [0]\n            change [level v] by (1)\n        end\n    end\n    if <<touching (rising lava v)?> or <touching (spikes v)?>> then\n        if <<(level) = [11]> or <(level) = [15]>> then\n            change [deaths on hard level v] by (1)\n        end\n        Respawn [-210] [0]\n    end\n    switch costume to (angry bird v)\nend\n\ndefine Respawn (x) (y)\nset [x speed v] to [0]\nset [y speed v] to [0]\ngo to x: (x) y: (y)\n\ndefine Change X (x speed)\nset [slope v] to [0]\nif <(touching ground) = [1]> then\n    set [max slope v] to [15]\nelse\n    set [max slope v] to [1]\nend\nchange x by (x speed)\nif <touching (platforms v)?> then\n    repeat until <<not <touching (platforms v)?>> or <(slope) = (max slope)>>\n        change y by (1)\n        change [slope v] by (1)\n    end\nend\nif <(slope) = (max slope)> then\n    change y by (() - (slope))\n    set [x speed v] to [0]\n    if <(x speed) > [0]> then\n        repeat until <not <touching (platforms v)?>>\n            change x by (-1)\n        end\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(air time) > [5]>> then\n            set [y speed v] to [15]\n            set [x speed v] to [-10]\n            start sound [Basketball Bounce v]\n        end\n    else\n        repeat until <not <touching (platforms v)?>>\n            change x by (1)\n        end\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(air time) > [5]>> then\n            set [y speed v] to [15]\n            set [x speed v] to [10]\n            start sound [Basketball Bounce v]\n        end\n    end\nend\nif <(touching ground) = [1]> then\n    change y by (-15)\n    if <touching (platforms v)?> then\n        repeat until <not <touching (platforms v)?>>\n            change y by (1)\n        end\n    else\n        change y by (15)\n    end\nend\n\ndefine Change Y (y speed)\nchange y by (y speed)\nset [touching ground v] to [0]\nif <touching (platforms v)?> then\n    set [y speed v] to [0]\n    if <<(y speed) > [0]> or <(y speed) = [0]>> then\n        repeat until <not <touching (platforms v)?>>\n            change y by (-1)\n        end\n    else\n        set [touching ground v] to [1]\n        set [air time v] to [0]\n        repeat until <not <touching (platforms v)?>>\n            change y by (1)\n        end\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\n\nset size to (100) %\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <<touching (sprite1 v)?> or <(y position) < [-180]>> then\n        start sound [Seagulls3 v]\n        Respawn [-200] [100]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) > [240]> then\n        change [level v] by (1)\n        broadcast (Next Level v) and wait\n        Respawn [-200] [100]\n    end\nend\n\n@Platforms\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    switch costume to (level)\nend\n\nset [level v] to [13]\n\nwhen flag clicked\nforever\n    if <(level) = [14]> then\n        start sound [Crowd Gasp v]\n        wait until <not <(level) = [14]>>\n    end\n    if <(level) = [15]> then\n        start sound [Goal Cheer v]\n        wait until <not <(level) = [15]>>\n    end\nend\n\n@Exit\n\n@Sprite1\n\nwhen flag clicked\nforever\n    switch costume to (level)\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    repeat (10)\n        change y by (0.2)\n    end\n    repeat (10)\n        change y by (-0.2)\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to [front v] layer\nclear graphic effects\nrepeat (10)\n    change [pixelate v] effect by (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\n