Platformer engine
@Stage\n\n@Blank\n\n@Platforms\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\n@Player\n\nwhen flag clicked\nswitch costume to (costume2 v)\nforever\n    if <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <key (up arrow v) pressed?>> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen flag clicked\ngo to x: (-216) y: (100)\nset [level v] to [1]\nshow\nforever\n    go to [back v] layer\n    set [y v] to [0]\n    set [x v] to [0]\n    forever\n        change [y v] by (-1)\n        set [x v] to ((x) * (0.9))\n        if <key (left arrow v) pressed?> then\n            change [x v] by (-1)\n        end\n        if <key (right arrow v) pressed?> then\n            change [x v] by (1)\n        end\n        change x by (x)\n        if <touching (platforms v)?> then\n            change y by (1)\n        end\n        if <touching (platforms v)?> then\n            change y by (1)\n        end\n        if <touching (platforms v)?> then\n            change y by (1)\n        end\n        if <touching (platforms v)?> then\n            change y by (1)\n        end\n        if <touching (platforms v)?> then\n            change y by (-4)\n            change x by ((x) * (-1))\n            if <key (up arrow v) pressed?> then\n                set [y v] to [10]\n                if <([abs v] of (x) ) = (x)> then\n                    set [x v] to [-4]\n                else\n                    set [x v] to [4]\n                end\n            else\n                set [x v] to [0]\n            end\n        end\n        change y by (y)\n        if <touching (platforms v)?> then\n            change y by ((y) - ((y) * (2)))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<key (up arrow v) pressed?> and <touching (platforms v)?>> then\n            set [y v] to [15]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (danger v)?> or <touching (lava v)?>> then\n        go to x: (-216) y: (100)\n    end\n    if <(x position) = [239]> then\n        broadcast (Next Level v)\n        change [level v] by (1)\n        go to x: (-216) y: (100)\n    end\nend\n\nwhen I start as a clone\nrepeat (100)\n    change [ghost v] effect by (15)\n    change size by (-15)\nend\ndelete this clone\n\nwhen flag clicked\nshow\n\nwhen I receive [the end v]\nhide\n\nchange y by (1)\nif <touching (bounce pads v)?> then\n    set [y v] to [19]\nend\n\nwhen flag clicked\nforever\n    if <touching color (#373737)?> then\n        go to [front v] layer\n    end\nend\n\n@Danger\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Platforms2\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\n
Platformer engine. use with credit. \n\nInstructions\n\nArrow keys to move, dodge the spikes\n\nlike and star for part two xd. Also ask if you want another animation. \n\n