Sunset - A Platformer
@Stage\n\n@Thumbnail\n\nwhen flag clicked\nstart sound [Best Day of my Life v]\nhide\n\ngo to [front v] layer\nshow\n\n@Orange\n\ndefine Movement\nchange [y velocity v] by (-1)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x velocity v] by (-1)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x velocity v] by (1)\nend\nset [x velocity v] to ((X Velocity) * (0.9))\nchange x by (X Velocity)\nif <touching (red v)?> then\n    change y by (1)\nend\nif <touching (red v)?> then\n    change y by (1)\nend\nif <touching (red v)?> then\n    change y by (1)\nend\nif <touching (red v)?> then\n    change y by (1)\nend\nif <touching (red v)?> then\n    change y by (-4)\n    change x by ((X Velocity) * (-1))\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        set [y velocity v] to [13]\n        if <(X Velocity) > [0]> then\n            set [x velocity v] to [-10]\n        else\n            set [x velocity v] to [10]\n        end\n    else\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (red v)?> then\n    change y by ((Y Velocity) * (-1))\n    set [y velocity v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (red v)?>> then\n    set [y velocity v] to [15]\nend\nchange y by (1)\n\nwhen flag clicked\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nReset\nforever\n    Movement\n    if <(x position) > [241]> then\n        broadcast (NEXT LEVEL v)\n        Reset\n    end\nend\n\ndefine Reset\ngo to x: (-180) y: (0)\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (19)\nend\ndelete this clone\n\nwhen flag clicked\nshow\nforever\n    if <touching (yellow v)?> then\n        Reset\n        repeat (10)\n            set [ghost v] effect to (10)\n        end\n    end\nend\n\nhide\n\n@Red\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\nhide\n\n@Yellow\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (1 v)\n\nwhen I receive [next level v]\nnext costume\n\nhide\n\n