Robo - A Platformer

Instructions: All directions are in-game\n\nAll levels are possible\n\nI hope you enjoy

@Stage\n\nwhen I receive [nextlevel v]\nif <(Level) = [14]> then\n    switch backdrop to (finished! v)\n    broadcast (finished v)\n    change [level v] by (1)\n    stop [all v]\nelse\n    switch backdrop to (next backdrop v)\nend\n\nwhen I receive [gameover v]\nswitch backdrop to (game over v)\nstop [all v]\n\nwhen I receive [start v]\nswitch backdrop to (level 1 v)\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\n@player\n\nwhen flag clicked\nhide\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [start v]\nset [game over v] to [0]\nshow\ngo to x: (-208) y: (-77)\npoint in direction (90)\nset [level v] to [1]\nset [yv v] to [0]\nset [xv v] to [0]\nforever\n    change [yv v] by (-0.5)\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (0.7)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-0.7)\n    end\n    if <key (d v) pressed?> then\n        change [xv v] by (0.7)\n    end\n    if <key (a v) pressed?> then\n        change [xv v] by (-0.7)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#7f7f7f)?> then\n        change y by (1)\n        if <touching color (#7f7f7f)?> then\n            change y by (1)\n            if <touching color (#7f7f7f)?> then\n                change y by (1)\n                if <touching color (#7f7f7f)?> then\n                    change y by (1)\n                    if <touching color (#7f7f7f)?> then\n                        change y by (1)\n                        if <touching color (#7f7f7f)?> then\n                            change x by ((Xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                            if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <key (space v) pressed?>>> then\n                                start sound [pop v]\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-8]\n                                else\n                                    set [xv v] to [8]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Yv)\n    if <touching color (#7f7f7f)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#7f7f7f)?> then\n        if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <key (space v) pressed?>>> then\n            start sound [pop v]\n            set [yv v] to [10]\n        end\n    end\n    if <touching color (#00ff55)?> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-208) y: (-77)\n        change [level v] by (1)\n        start sound [fairydust v]\n        broadcast (nextlevel v)\n    end\n    if <<<<touching color (#ff5730)?> or <touching (evil robot 1 v)?>> or <<touching (evil robot 3 v)?> or <touching (evil robot 2 v)?>>> or <<touching (evil robot 6 v)?> or <<touching (evil robot 5 v)?> or <touching (evil robot 4 v)?>>>> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        change [health v] by (-1)\n        start sound [death v]\n        if <(Health) < [1]> then\n            play sound [death v] until done\n            broadcast (gameover v)\n            hide\n            set [game over v] to [1]\n        end\n        go to x: (-208) y: (-77)\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    change y by (1)\n    turn right ((Xv) * (7)) degrees\nend\n\n@Heart 1\n\nwhen I receive [gameover v]\nhide\n\nwhen I receive [finished v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nset [health v] to [5]\nshow\nswitch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\ngo to x: (-210) y: (140)\nforever\n    if <(Health) < [1]> then\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-2 v)\n    else\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\n    end\nend\n\n@Heart 2\n\nwhen flag clicked\nhide\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [gameover v]\nhide\n\nwhen I receive [start v]\nshow\nswitch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\ngo to x: (-170) y: (140)\nforever\n    if <(Health) < [2]> then\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-2 v)\n    else\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\n    end\nend\n\n@Heart 3\n\nwhen I receive [gameover v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [start v]\nshow\nswitch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\ngo to x: (-130) y: (140)\nforever\n    if <(Health) < [3]> then\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-2 v)\n    else\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\n    end\nend\n\n@Heart 4\n\nwhen I receive [finished v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [gameover v]\nhide\n\nwhen I receive [start v]\nshow\nswitch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\ngo to x: (-90) y: (140)\nforever\n    if <(Health) < [4]> then\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-2 v)\n    else\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\n    end\nend\n\n@Heart 5\n\nwhen I receive [gameover v]\nhide\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [start v]\nshow\nswitch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\ngo to x: (-50) y: (140)\nforever\n    if <(Health) < [5]> then\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-2 v)\n    else\n        switch costume to (eco-energy-symbol-of-a-lightning-bolt_318-41534 v)\n    end\nend\n\nwhen flag clicked\nhide\n\n@evil robot 1\n\nwhen I receive [nextlevel v]\nif <<(Level) > [6]> or <(Level) < [6]>> then\n    hide\nend\n\nwhen I receive [gameover v]\nhide\n\nwhen I receive [finished v]\nhide\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [6]> then\n        go to x: (-100) y: (-125)\n        show\n        repeat (50)\n            point in direction (90)\n            move (5) steps\n        end\n        repeat (50)\n            move (-5) steps\n        end\n    else\n        hide\n    end\nend\n\n@evil robot 2\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [7]> then\n        go to x: (-25) y: (49)\n        show\n        repeat (30)\n            point in direction (90)\n            move (3) steps\n        end\n        repeat (30)\n            move (-3) steps\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [gameover v]\nhide\nstop [all v]\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [nextlevel v]\nif <<(Level) > [7]> or <(Level) < [7]>> then\n    hide\nend\n\n@Extra Life\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [9]> then\n        go to x: (0) y: (-102)\n        show\n    else\n        hide\n    end\n    if <touching (player v)?> then\n        if <(Health) < [5]> then\n            change [health v] by (1)\n            hide\n            play sound [laser2 v] until done\n            stop [this script v]\n        end\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [gameover v]\nhide\n\nwhen I receive [nextlevel v]\nif <<(Level) > [9]> or <(Level) < [9]>> then\n    hide\nend\n\n@Extra Life2\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [10]> then\n        go to x: (64) y: (40)\n        show\n    else\n        hide\n    end\n    if <touching (player v)?> then\n        if <(Health) < [5]> then\n            change [health v] by (1)\n            hide\n            play sound [laser2 v] until done\n            stop [this script v]\n        end\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [gameover v]\nhide\n\nwhen I receive [nextlevel v]\nif <<(Level) > [10]> or <(Level) < [10]>> then\n    hide\nend\n\n@evil robot 3\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [10]> then\n        go to x: (25) y: (121)\n        show\n        repeat (23)\n            point in direction (90)\n            move (3) steps\n        end\n        repeat (23)\n            move (-3) steps\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [gameover v]\nhide\nstop [all v]\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [nextlevel v]\nif <<(Level) > [10]> or <(Level) < [10]>> then\n    hide\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    go to x: (-1) y: (9)\nend\n\n@evil robot 4\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [12]> then\n        go to x: (-15) y: (-62)\n        show\n        repeat (21)\n            point in direction (90)\n            move (4) steps\n        end\n        repeat (21)\n            move (-4) steps\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [gameover v]\nhide\nstop [all v]\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [nextlevel v]\nif <<(Level) > [12]> or <(Level) < [12]>> then\n    hide\nend\n\nwhen flag clicked\nif <<(Level) > [12]> or <(Level) < [12]>> then\n    hide\nend\n\n@evil robot 5\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [12]> then\n        wait (0.05) seconds\n        go to x: (-134) y: (-99)\n        show\n        repeat (21)\n            point in direction (90)\n            move (4) steps\n        end\n        repeat (21)\n            move (-4) steps\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [gameover v]\nhide\nstop [all v]\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [nextlevel v]\nif <<(Level) > [12]> or <(Level) < [12]>> then\n    hide\nend\n\nwhen flag clicked\nif <<(Level) > [12]> or <(Level) < [12]>> then\n    hide\nend\n\n@evil robot 6\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [12]> then\n        wait (0.1) seconds\n        go to x: (110) y: (-100)\n        show\n        repeat (21)\n            point in direction (90)\n            move (4) steps\n        end\n        repeat (21)\n            move (-4) steps\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [gameover v]\nhide\nstop [all v]\n\nwhen I receive [finished v]\nhide\n\nwhen I receive [nextlevel v]\nif <<(Level) > [12]> or <(Level) < [12]>> then\n    hide\nend\n\nwhen flag clicked\nif <<(Level) > [12]> or <(Level) < [12]>> then\n    hide\nend\n\n@Intro\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [turn v] to [0]\nshow\nset size to (10) %\ngo to x: (0) y: (0)\nrepeat (3)\n    change size by (5)\nend\nrepeat (3)\n    change size by (10)\nend\nrepeat (3)\n    change size by (17)\nend\nrepeat (3)\n    change size by (21)\nend\nrepeat (2)\n    change size by (25)\nend\nrepeat (2)\n    change size by (30)\nend\nset [turn v] to [1]\nrepeat (2)\n    change size by (-30)\nend\nrepeat (2)\n    change size by (-25)\nend\nrepeat (3)\n    change size by (-21)\nend\nrepeat (3)\n    change size by (-17)\nend\nrepeat (3)\n    change size by (-10)\nend\nrepeat (5)\n    change size by (-5)\nend\nset [turn v] to [2]\nhide\nwait (0.3) seconds\nshow\npoint in direction (90)\nswitch costume to (coollogo_com-125341007 v)\nrepeat (12)\n    change size by (10)\nend\nwait (1) seconds\nbroadcast (Start v)\nhide\n\nwhen flag clicked\nrepeat until <(turn) = [1]>\n    turn right (8) degrees\nend\nrepeat until <(turn) = [2]>\n    turn left (8) degrees\nend\n\n