Ninja Platformer

Instructions: Instructions:\n- Arrow keys to move\n-a key to view scores\n-b key to hide scores\n-r key to reset levels\n- Avoid Lava 

@Stage\n\nwhen flag clicked\nforever\n    play sound [Waterflame - Jumper v] until done\nend\n\n@Player\n\nwhen flag clicked\nforever\n    set [☁ wr v] to (☁ WR)\nend\n\nwhen I receive [the end v]\nforever\n    if <(☁ WR) > (final seconds)> then\n        set [☁ wr v] to (final seconds)\n    end\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nReset Player Position\nset [force walk v] to [3]\nset [force gravity v] to [-1.5]\nset [force jump v] to [17]\nset [player speed x v] to [0]\nforever\n    Check Player Gravity\n    Check Player Walk\n    Check Player Touching\nend\n\ndefine move out (dx) (dy)\nrepeat until <not <touching color (#5e0000)?>>\n    change x by (dx)\n    change y by (dy)\nend\n\ndefine Check Player Gravity\nchange [player speed y v] by (FORCE GRAVITY)\nchange y by (Player Speed Y)\nif <touching color (#5e0000)?> then\n    if <(Player Speed Y) > [0]> then\n        move out [0] [-1]\n        set [player speed y v] to [0]\n    else\n        move out [0] [1]\n        if <key (up arrow v) pressed?> then\n            set [player speed y v] to (FORCE JUMP)\n        else\n            set [player speed y v] to [0]\n        end\n    end\nend\n\ndefine Check Player Walk\nif <key (left arrow v) pressed?> then\n    switch costume to (costume2 v)\n    change [player speed x v] by ((-1) * (FORCE WALK))\nend\nif <key (right arrow v) pressed?> then\n    change [player speed x v] by ((1) * (FORCE WALK))\n    switch costume to (costume1 v)\nend\nset [player speed x v] to ((Player Speed X) * (0.7))\nchange x by (Player Speed X)\nif <(Player Speed X) > [0]> then\n    move out [-1] [0]\nelse\n    move out [1] [0]\nend\n\ndefine Check Player Touching\nif <touching color (#4cbf56)?> then\n    broadcast (Complete level v) and wait\n    Reset Player Position\n    next backdrop\nend\nif <touching color (#7971ff)?> then\n    set [player speed y v] to [25]\nend\nif <touching color (#b9b9b9)?> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    Reset Player Position\nend\nif <touching color (#ff0000)?> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    Reset Player Position\nend\nif <touching color (#000000)?> then\n    broadcast (The End v)\nend\n\ndefine Reset Player Position\nclear graphic effects\ngo to x: (-200) y: (-10)\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen flag clicked\nshow variable [sec v]\nset [sec v] to [0]\nforever\n    wait (1) seconds\n    change [sec v] by (1)\nend\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        Reset Player Position\n    end\nend\n\nwhen [a v] key pressed\n\nwhen [b v] key pressed\n\nwhen flag clicked\nforever\n    say (username)\nend\n\n@Sprite1\n\nwhen flag clicked\nset [final seconds v] to [0]\nhide variable [final seconds v]\nhide\n\nwhen I receive [the end v]\nhide variable [sec v]\nshow variable [final seconds v]\ngo to [front v] layer\nshow\n\nwhen I receive [the end v]\nset [final seconds v] to (Sec)\n\n@Numbers\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [backdrop1 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (1 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop2 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (2 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop3 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (3 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop4 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (4 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop5 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (5 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop6 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (6 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop7 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (7 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop8 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (8 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop9 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (9 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop10 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (10 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop11 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (11 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop12 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (12 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop13 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (13 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop14 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (14 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop15 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (15 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop16 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (16 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop17 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (17 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop18 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (18 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop19 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (19 v)\nshow\nwait (1) seconds\nrepeat (4)\n    change [ghost v] effect by (50)\n    wait (.1) seconds\nend\n\nwhen backdrop switches to [backdrop20 v]\nclear graphic effects\ngo to x: (-1) y: (136)\nswitch costume to (20 v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (.1) seconds\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow variable [☁ wr v]\nhide\n\n