Darkness II A Platformer

Instructions:                      ✯ Darkness II A Platformer ✯\n\n                                    ~STORY~\n-----------------------------------------------------------------\nDark was just living his normal life when suddenly he was sucked into a hole of darkness.Now, he travels through this abandoned world and is desperately looking for light. Will he survive...... \n-----------------------------------------------------------------\n                  \n                       \n\n\n                            INSTRUCTIONS \n-----------------------------------------------------------------\nUse arrow keys to move\nAvoid spikes and lava\nCollect the coins to open the portal\nHave fun!\n\n\n

@Stage\n\n@player \n\nwhen flag clicked\nhide\nset [menu v] to [0]\nset size to (100) %\nset [ghost v] effect to (0)\nset [x v] to [0]\nset [y v] to [0]\nbroadcast (green flag v) and wait\nbroadcast (play. game v) and wait\n\nwhen I receive [play. game v]\nhide variable [collected v]\nset [hj v] to [0]\nset [level v] to [1]\nforever\n    broadcast (reset v) and wait\n    broadcast (setup v) and wait\n    Game on\n    repeat until <(Exit) > []>\n        tick\n        broadcast (tick v) and wait\n    end\n    if <(Exit) = [win]> then\n        Game win\n    else\n        Game-Die\n    end\nend\n\ndefine Game on\nif <(LEVEL) = [2]> then\n    switch backdrop to (backdrop2 v)\nend\nif <(LEVEL) = [1]> then\n    switch backdrop to (savanna v)\nend\nif <(LEVEL) = [3]> then\n    switch backdrop to (backdrop1 \(2\) v)\nend\nif <(LEVEL) = [4]> then\n    switch backdrop to (backdrop1 \(3\) v)\nend\nset [x v] to [-220]\nset [y v] to [-100]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [sx v] to [0]\nshow\n\ndefine tick\nif <key (left arrow v) pressed?> then\n    change [sx v] by (-1.5)\n    point in direction (-90)\nend\nif <key (right arrow v) pressed?> then\n    change [sx v] by (1.5)\n    point in direction (90)\nend\nset [sx v] to ((sx) * (0.8))\nif <[0.9] < ([abs v] of (sx) )> then\n    Change player x by (round (sx))\nend\nif <key (up arrow v) pressed?> then\n    if <(In air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <[-20] < (sy)> then\n    change [sy v] by (-2)\nend\nChange player y by (sy)\nset [scroll x v] to (X)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nchange [scroll y v] by (round (((Y) - (SCROLL Y)) / (10)))\nPosition\nif <(LEVEL) = [2]> then\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nTest die\nrepeat until <not <touching (platform v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((X) - (SCROLL X)) y: ((Y) - (SCROLL Y))\n\ndefine Change player x by (sx)\nchange [x v] by (sx)\nPosition\nTest die\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <key (up arrow v) pressed?> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platform v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Test die\nif  then\n    set [exit v] to [die]\nend\n\ndefine Game win\nset rotation style [left-right v]\nrepeat (50)\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (5)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\nshow\nset size to (100) %\nset [ghost v] effect to (0)\nset rotation style [left-right v]\n\ndefine Game-Die\nhide variable [collected v]\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\nwhen flag clicked\nset [tim v] to [.1]\nforever\n    set [tim v] to ((timer) + (.1))\nend\n\nwhen [timer v] > (tim)\nbroadcast (k v)\nbroadcast (thum v)\n\nwhen I receive [k v]\nhide\n\nwhen [s v] key pressed\nset [in v] to [1]\n\nwhen I receive [thum v]\nhide\n\nwhen I receive [reset v]\n\n@spikes\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [-11]\nset [y v] to [-50]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1  v)\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (costume1 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [k v]\nhide\n\n@platform3\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [-11]\nset [y v] to [-50]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 2 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 4 1  v)\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n            else\n                if <(LEVEL) = [5]> then\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: ((y) + (lr))\nif <<(x) = (x position)> and <((y) + (lr)) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [k v]\nhide\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <<(LEVEL) = [2]> or <<<(LEVEL) = [4]> or <(LEVEL) = [5]>> or <<(LEVEL) = [3]> or <(LEVEL) = [1]>>>> then\n        set [lr v] to [4]\n        forever\n            repeat (10)\n                change [lr v] by (2)\n            end\n            wait (0.1) seconds\n            repeat (10)\n                change [lr v] by (-2)\n            end\n            wait (0.1) seconds\n        end\n    end\nend\n\n@portal\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\nif <<touching (player  v)?> and <(costume [name v]) = [open]>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide variable [mouse v]\nset [collected max v] to [0]\nset [collected v] to [0]\nhide\nset [y v] to [-16]\nif <(LEVEL) = [1]> then\n    switch costume to (open2 v)\n    Clone at x: [700] y: [28]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (open2 v)\n        Clone at x: [155] y: [91]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (open2 v)\n            Clone at x: [625] y: [37]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at x: [289] y: [-2]\n            else\n                if <(LEVEL) = [6]> then\n                    Clone at x: [10000000] y: [1000000000]\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: ((y) + (pr))\nif <<(x) = (x position)> and <((y) + (pr)) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [op v]\nswitch costume to (open v)\n\nwhen I receive [k v]\nhide\n\nwhen flag clicked\nforever\n    set [pr v] to [7]\n    forever\n        repeat (15)\n            change [pr v] by (1)\n        end\n        wait (0.1) seconds\n        repeat (15)\n            change [pr v] by (-1)\n        end\n        wait (0.1) seconds\n    end\nend\n\n@coins\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\nif <touching (player  v)?> then\n    change [collected v] by (1)\n    if <(COLLECTED MAX) = (collected)> then\n        broadcast (op v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide variable [mouse v]\nset [collected v] to [0]\nhide\nset [y v] to [-16]\nif <(LEVEL) = [1]> then\n    Clone at x: [-68] y: [1]\n    Clone at x: [25] y: [1]\n    Clone at x: [116] y: [1]\n    Clone at x: [215] y: [1]\n    Clone at x: [302] y: [16]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at x: [-93] y: [-21]\n        Clone at x: [1] y: [95]\n        Clone at x: [17] y: [-48]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at x: [286] y: [-62]\n            Clone at x: [166] y: [-62]\n            Clone at x: [47] y: [-62]\n        else\n            if <(LEVEL) = [5]> then\n                switch costume to (level 1 1 \(1\) v)\n                Clone at x: [-66] y: [124]\n                Clone at x: [-167] y: [329]\n                Clone at x: [17] y: [259]\n                Clone at x: [163] y: [203]\n            end\n        end\n    end\nend\nset [x v] to [6656446455455645]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nchange [collected max v] by (1)\n\nwhen I receive [k v]\nhide\n\nwhen [r v] key pressed\nbroadcast (reset v)\nbroadcast (setup v)\nbroadcast (play. game v)\n\nwhen I receive [play. game v]\nforever\n    hide variable [collected v]\nend\n\n@platform\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [-11]\nset [y v] to [-50]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: []\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1  v)\n            Clone at x: [400] y: []\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1  v)\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (the end v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nswitch costume to (level 5 1 v)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [k v]\nhide\n\nwhen I receive [play. game v]\nforever\n    if <(costume [number v]) = [29]> then\n        broadcast (game done.com v)\n    end\nend\n\n@Sprite1\n\nwhen [m v] key pressed\nset [mouse v] to (join ((SCROLL X) + (mouse x)) (join [, ] ((SCROLL Y) + (mouse y))))\nshow variable [mouse v]\n\nwhen flag clicked\nset [in v] to [0]\nhide variable [mouse v]\nhide variable [collected max v]\nhide variable [e v]\nhide variable [collected v]\n\nwhen I receive [play. game v]\n\nwhen flag clicked\nforever\n    play sound [Inferno  v] until done\nend\n\n@Sprite2\n\nwhen flag clicked\nforever\n    hide\nend\n\n