Dark Hero - A Platformer

Instructions: WASD or arrow keys to move (NEW: W and down key)\nrestart level - r \nSkip level - hint in instructions somewhere\nGoal: get to the teleporter\nAvoid light!\nAll levels are possible\nYOU WILL NEED A LOT OF PATIENTS TO DO THIS!

@Stage\n\n@player\n\nwhen I receive [boss v]\nset size to (70) %\nstop [other scripts in sprite v]\nbroadcast (clons! v)\nset [y v] to [0]\ngo to x: (0) y: (-110)\nshow\nswitch costume to (costume3 v)\nrepeat (12)\n    change [y v] by (1)\n    change y by (y)\nend\nrepeat (20)\n    change [y v] by (-1)\n    change y by (y)\nend\nrepeat until <touching (_edge_ v)?>\n    change [y v] by (1)\n    change y by (y)\nend\nstop [other scripts in sprite v]\nhide\nbroadcast (win v)\n\nwhen I start as a clone\nset size to (300) %\nswitch costume to (kostium1 v)\nshow\nclear graphic effects\nrepeat (10)\n    change [ghost v] effect by (12)\n    change size by (-20)\nend\ndelete this clone\n\nwhen I receive [clons! v]\nwait (0) seconds\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nset rotation style [don't rotate v]\nforever\n    go to [front v] layer\nend\n\nbroadcast (boss v)\n\ndelete this clone\n\nwhen flag clicked\nset [wait2 v] to [0]\nset [wait v] to [0]\nforever\n    if <touching (teleport v)?> then\n        hide\n        broadcast (levels v)\n        wait (0.3) seconds\n        switch costume to (costume3 v)\n        go to x: (-200) y: (-110)\n        clear graphic effects\n        show\n    end\nend\n\nwhen [0 v] key pressed\n\nwhen flag clicked\nswitch costume to (costume3 v)\nset size to (70) %\ngo to x: (-200) y: (-110)\nclear graphic effects\nshow\nforever\n    if <touching (lights v)?> then\n        start sound [Coin v]\n        go to x: (-213) y: (-100)\n        switch costume to (costume3 v)\n        set size to (70) %\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (costume3 v)\n        point in direction (90)\n        change [xv v] by (0.7)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (costume2 v)\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 (levels v)?> then\n        change y by (1)\n        if <touching (levels v)?> then\n            change y by (1)\n            if <touching (levels v)?> then\n                change y by (1)\n                if <touching (levels v)?> then\n                    change y by (1)\n                    if <touching (levels v)?> then\n                        change y by (1)\n                        if <touching (levels v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [9]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching (levels v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#7337af)?> then\n        set [yv v] to [19]\n    else\n        if <touching (levels v)?> then\n            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                set [yv v] to [13]\n                start sound [B Elec Guitar v]\n            end\n        end\n    end\n    change y by (1)\n    if <touching color (#3f5aaf)?> then\n        set [xv v] to [20]\n        start sound [chord v]\n    end\n    if <touching color (#006622)?> then\n        go to x: (203) y: (-77)\n        start sound [boing v]\n    end\nend\n\nwhen [r v] key pressed\nif <not <(wait2) = [1]>> then\n    hide\n    broadcast (dark v)\n    wait (0.3) seconds\n    switch costume to (costume3 v)\n    go to x: (-200) y: (-110)\n    clear graphic effects\n    show\n    wait until <not <key (n v) pressed?>>\n    wait (2) seconds\nend\n\nwhen flag clicked\nforever\n    if <<key (s v) pressed?> and <key (p v) pressed?>> then\n        if <not <(wait) = [1]>> then\n            hide\n            broadcast (levels v)\n            wait (0.3) seconds\n            switch costume to (costume3 v)\n            go to x: (-200) y: (-110)\n            clear graphic effects\n            show\n            wait until <not <key (n v) pressed?>>\n            wait (1) seconds\n        end\n    end\nend\n\ndefine No (cheating!) Or Else! <hahahahaha>\n\nwhen flag clicked\nforever\n    if <<<key (s v) pressed?> or <key (down arrow v) pressed?>> and <(Yv) < [20]>> then\n        change [yv v] by (-5)\n    end\nend\n\nset [yv v] to [-10]\n\n@levels\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nswitch costume to (kostium1 v)\ngo to [front v] layer\n\nwhen I receive [levels v]\nwait (0.2) seconds\nnext costume\nif <(costume [number v]) = [22]> then\n    set [wait v] to [1]\n    set [wait2 v] to [1]\n    broadcast (boss v)\nend\n\n@back\n\nwhen flag clicked\nshow\nforever\n    go to [back v] layer\nend\n\n@song\n\nwhen flag clicked\nforever\n    play sound [Dancing Line - The Earth \(Color Remix\) \(Soundtrack\) v] until done\nend\n\n@2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset rotation style [all around v]\npoint in direction (90)\nset [ghost v] effect to (70)\ngo to [back v] layer\ngo to x: (0) y: (0)\nshow\nset [sine v] to [0]\nforever\n    change [sine v] by (7.5)\n    point in direction ((([sin v] of (sine) ) * (0.5)) + (90))\nend\n\n@3\n\nwhen flag clicked\nhide\n\ngo to x: (0) y: (0)\nshow\npoint in direction (90)\nset [ghost v] effect to (80)\nset [brightness v] effect to (10)\nforever\n    turn right (2) degrees\nend\n\n@effects\n\nwhen flag clicked\nhide\nforever\n    wait (0.01) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [front v] layer\nset [ghost v] effect to (0)\nset size to (100) %\nshow\ngo to x: (pick random (230) to (-230)) y: (-180)\nrepeat (10)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@effects2\n\nwhen flag clicked\nhide\nforever\n    wait (0.05) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to (random position v)\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\nset size to (100) %\nrepeat (10)\n    change size by (1)\n    change [ghost v] effect by (-3)\n    change [brightness v] effect by (10)\nend\nrepeat (10)\n    change size by (-1)\n    change [ghost v] effect by (3)\n    change [brightness v] effect by (-10)\nend\ndelete this clone\n\n@lights\n\nwhen flag clicked\nswitch costume to (kostium1 v)\ngo to x: (0) y: (0)\n\nwhen I receive [levels v]\nwait (0.2) seconds\nnext costume\nshow\nset [ghost v] effect to (0)\nset [brightness v] effect to (10)\nforever\n    show\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    wait (1) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (1) seconds\nend\n\n@teleport\n\nwhen flag clicked\ngo to x: (200) y: (-112)\nshow\nset [sine v] to [0]\nforever\n    change [sine v] by (7.5)\n    point in direction ((([sin v] of (sine) ) * (15)) + (90))\n    set size to ((([sin v] of ((sine) * (2)) ) * (7)) + (80)) %\nend\n\nwhen I receive [boss v]\nhide\n\nwhen flag clicked\nswitch costume to (kostium1 v)\nforever\nend\n\n@black\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [levels v]\nshow\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\nwait (0.1) seconds\nrepeat (4)\n    change [ghost v] effect by (25)\nend\nhide\n\nwhen I receive [dark v]\nshow\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\nwait (0.1) seconds\nrepeat (4)\n    change [ghost v] effect by (25)\nend\nhide\n\n@Win\n\nwhen I receive [win v]\nshow\nset [ghost v] effect to (100)\nset [brightness v] effect to (10)\nforever\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (1) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    wait (1) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\n\n@Sprite1\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\n\nwhen I start as a clone\ngo to [back v] layer\nset [color v] effect to (0)\ngo to (teleport v)\nshow\npoint in direction (pick random (0) to (360))\nrepeat (10)\n    move (5) steps\n    change [ghost v] effect by (10)\n    change size by (-10)\nend\ndelete this clone\n\n@thumbnail\n\nwhen I receive [play on v]\nshow\nwait (1) seconds\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [play on v]\n\n@ELA\n\nwhen flag clicked\nshow\nset [ghost v] effect to (0)\nswitch costume to (costume1 v)\nwait (4) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (costume2 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (costume3 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nchange [ghost v] effect by (10)\n\n