Tricky Ninja || A Platformer
@Stage\n\nwhen flag clicked\nset [timer enabled? v] to [0]\nswitch backdrop to (backdrop1 v)\nhide variable [timer! v]\n\nwhen I receive [timer! v]\nset [timer! v] to [- - -]\nwait (.5) seconds\nset [timer enabled? v] to [1]\nshow variable [timer! v]\n\nwhen I receive [reset v]\nset [timer! v] to [- - -]\nwait (.1) seconds\nif <(TIMER ENABLED?) = [1]> then\n    set [timer! v] to (TIME!)\n    repeat until <(TIMER!) = [0]>\n        wait (1) seconds\n        change [timer! v] by (-1)\n    end\n    broadcast (Reset v)\nend\n\nwhen I receive [next level v]\nset [timer! v] to [- - -]\nwait (.1) seconds\nif <(TIMER ENABLED?) = [1]> then\n    set [timer! v] to (TIME!)\n    repeat until <(TIMER!) = [0]>\n        wait (1) seconds\n        change [timer! v] by (-1)\n    end\n    broadcast (Reset v)\nend\n\nwhen flag clicked\nforever\n    play sound [the ninja reg v] until done\nend\n\n@Player\n\nwhen flag clicked\nforever\n    if <not <(Y Velocity) = [0]>> then\n        if <(costume [number v]) = [2]> then\n            turn left (20) degrees\n            if <key (left arrow v) pressed?> then\n                turn right (20) degrees\n            end\n        end\n        if <(costume [number v]) = [3]> then\n            turn right (20) degrees\n            if <key (right arrow v) pressed?> then\n                turn left (20) degrees\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (-216) y: (-50)\npoint in direction (90)\nset size to (150) %\nshow\nforever\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x velocity v] by (-1.8)\n        turn left (20) degrees\n        switch costume to (left v)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x velocity v] by (1.8)\n        turn right (20) degrees\n        switch costume to (right v)\n    end\n    set [x velocity v] to ((X Velocity) * (0.85))\n    change x by (X Velocity)\n    if <<<touching color (#00ff3a)?> or <touching color (#00bb2c)?>> or <touching color (#8a5300)?>> then\n        change y by (1)\n    end\n    if <<<touching color (#00ff3a)?> or <touching color (#00bb2c)?>> or <touching color (#8a5300)?>> then\n        change y by (1)\n    end\n    if <<<touching color (#00ff3a)?> or <touching color (#00bb2c)?>> or <touching color (#8a5300)?>> then\n        change y by (1)\n    end\n    if <<<touching color (#00ff3a)?> or <touching color (#00bb2c)?>> or <touching color (#8a5300)?>> then\n        change y by (1)\n    end\n    if <<<touching color (#00ff3a)?> or <touching color (#00bb2c)?>> or <touching color (#8a5300)?>> 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?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\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            set [y velocity v] to [15]\n        else\n            set [x velocity v] to [0]\n        end\n    end\n    change [y velocity v] by (-2)\n    change y by (Y Velocity)\n    if <<<touching color (#00ff3a)?> or <touching color (#00bb2c)?>> or <touching color (#8a5300)?>> then\n        change y by ((Y Velocity) - ((Y Velocity) * (2)))\n        set [y velocity v] to [0]\n    end\n    change y by (-3)\n    if <<<<touching color (#00ff3a)?> or <touching color (#00bb2c)?>> or <touching color (#8a5300)?>> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        start sound [Low Whoosh v]\n        set [y velocity v] to [20]\n    end\n    if <touching color (#ffe900)?> then\n        set [y velocity v] to [20]\n    end\n    change y by (3)\n    if <<touching color (#d3d4d4)?> or <<touching color (#eaeaea)?> or <touching color (#ff0000)?>>> then\n        repeat (4)\n            change [ghost v] effect by (25)\n        end\n        broadcast (Reset v)\n        create clone of (_myself_ v)\n    end\n    if <(y position) < [-150]> then\n        repeat (4)\n            change [ghost v] effect by (25)\n        end\n        broadcast (Reset v)\n        create clone of (_myself_ v)\n    end\n    if <<touching color (#ef1a06)?> or <touching color (#fd9b23)?>> then\n        repeat (4)\n            change [ghost v] effect by (25)\n        end\n        broadcast (Reset v)\n        create clone of (_myself_ v)\n    end\n    if <touching (sprite1 v)?> then\n        broadcast (Reset v)\n        next backdrop\n    end\nend\n\nwhen I receive [next level v]\nbroadcast (Reset v)\n\nwhen I start as a clone\nclear graphic effects\nrepeat (10)\n    change [ghost v] effect by (10)\n    turn right (5) degrees\n    change y by (5)\nend\ndelete this clone\n\nwhen I receive [reset v]\nset [ghost v] effect to (0)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-216) y: (-50)\n\n@Player Trail\n\nwhen flag clicked\ngo to [back v] layer\nshow\nforever\n    point in direction ([direction v] of [player v])\n    switch costume to ([costume name v] of [player v])\n    go to x: ([x position v] of [player v]) y: ([y position v] of [player v])\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nrepeat (10)\n    change [ghost v] effect by (21)\nend\ndelete this clone\n\nwhen I receive [scroll v]\nhide\ndelete this clone\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (162) y: (-128)\npoint in direction (90)\nshow\n\nwhen backdrop switches to [backdrop2 v]\ngo to x: (178) y: (-47)\n\nwhen backdrop switches to [backdrop3 v]\ngo to x: (-149) y: (110)\n\nwhen backdrop switches to [backdrop4 v]\ngo to x: (-99) y: (125)\n\nwhen backdrop switches to [backdrop5 v]\ngo to x: (209) y: (100)\n\nwhen backdrop switches to [backdrop6 v]\ngo to x: (191) y: (2)\npoint in direction (0)\n\nwhen backdrop switches to [backdrop7 v]\ngo to x: (-183) y: (69)\npoint in direction (-27)\n\nwhen backdrop switches to [backdrop8 v]\ngo to x: (184) y: (-89)\npoint in direction (145)\n\nwhen backdrop switches to [backdrop9 v]\ngo to x: (186) y: (-130)\nbroadcast (TIMER! v)\npoint in direction (90)\n\nwhen backdrop switches to [backdrop10 v]\nset [time! v] to [3]\ngo to x: (204) y: (37)\npoint in direction (90)\n\nwhen backdrop switches to [backdrop11 v]\nset [time! v] to [8]\ngo to x: (-185) y: (105)\npoint in direction (90)\n\nwhen backdrop switches to [backdrop12 v]\nset [time! v] to [7]\ngo to x: (-150) y: (135)\npoint in direction (90)\n\nwhen backdrop switches to [backdrop13 v]\nset [time! v] to [3]\ngo to x: (177) y: (108)\npoint in direction (90)\n\nwhen backdrop switches to [backdrop14 v]\nset [time! v] to [1]\ngo to x: (0) y: (-20)\npoint in direction (90)\n\nwhen backdrop switches to [backdrop15 v]\nset [time! v] to [2]\ngo to x: (163) y: (-83)\npoint in direction (90)\n\nwhen backdrop switches to [backdrop17 v]\nset [timer enabled? v] to [0]\nhide variable [timer! v]\nhide\n\nwhen backdrop switches to [backdrop16 v]\nset [time! v] to [10]\ngo to x: (-222) y: (58)\npoint in direction (90)\n\n@Sprite2\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\n
Ready to go on a dizzy journey with a tricky ninja?\n\nUse the arrow keys to jump and move\nDodge lava\nReach the flag to complete a level