Hanok's Adventures [PLATFORMER GAME] 

Instructions: - Robot a multiplayer platformer - \nInstructions: Arrow keys or WASD to move. Avoid spikes.\nServer up to 10 players.

@Stage\n\n@Blank\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\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 Death\n        set [y v] to [0]\n    end\nend\n\ndefine Game On\nset [x v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [y v] to [0]\nset [exit v] to []\nset [in air v] to [0]\nshow\n\ndefine Tick\nif <not <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>> then\n    switch costume to (straight v)\nend\nif <key (left arrow v) pressed?> then\n    change [sx v] by (-2)\n    switch costume to (left v)\nend\nif <key (right arrow v) pressed?> then\n    change [sx v] by (2)\n    switch costume to (right v)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0,9]> 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 <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player Y by (sy)\nLava Die\nNext level\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(LEVEL) = [1]> then\n    if <(SCROLL X) > [720]> then\n        set [scroll x v] to [720]\n    end\nelse\n    if <(LEVEL) = [2]> then\n        if <(SCROLL X) > [720]> then\n            set [scroll x v] to [720]\n        end\n    else\n        if <(LEVEL) = [3]> then\n            if <(SCROLL X) > [1321]> then\n                set [scroll x v] to [1321]\n            end\n        else\n            if <(LEVEL) = [4]> then\n                if <(SCROLL X) > [1918]> then\n                    set [scroll x v] to [1918]\n                end\n            else\n                if <(LEVEL) = [5]> then\n                    if <(SCROLL X) > [1459]> then\n                        set [scroll x v] to [1459]\n                    end\n                else\n                    if <(LEVEL) = [6]> then\n                        if <(SCROLL X) > [1769]> then\n                            set [scroll x v] to [1769]\n                        end\n                    else\n                        if <(LEVEL) = [7]> then\n                            if <(SCROLL X) > [0]> then\n                                set [scroll x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nposition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\nChange Player x by [-8]\n\ndefine Change Player Y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nposition\nrepeat until <not <touching (level 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\nif <touching (level v)?> then\n    repeat (12)\n        change [y v] by (1)\n        position\n        if <not <touching (level 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 (level 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\nLava Die\n\ndefine Game Death\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\ndefine Lava Die\nif <not <(LEVEL) = [1]>> then\n    if <touching (danger v)?> then\n        set [exit v] to [die]\n    end\nend\n\nwhen I receive [play game v]\n\nforever\n\nif <key (right arrow v) pressed?> then\nif <key (left arrow v) pressed?> then\n\nset [scroll y v] to (y)\n\ndefine Next level\nif <(LEVEL) = [1]> then\n    if <(x) > [791]> then\n        if <touching (portal v)?> then\n            set [exit v] to [win]\n        end\n    end\nelse\n    if <(LEVEL) = [2]> then\n        if <(x) > [794]> then\n            if <touching (portal v)?> then\n                set [exit v] to [win]\n            end\n        end\n    else\n        if <(LEVEL) = [3]> then\n            if <(x) > [1393]> then\n                if <touching (portal v)?> then\n                    set [exit v] to [win]\n                end\n            end\n        else\n            if <(LEVEL) = [4]> then\n                if <(x) > [2000]> then\n                    if <touching (portal v)?> then\n                        set [exit v] to [win]\n                    end\n                end\n            else\n                if <(LEVEL) = [5]> then\n                    if <(x) > [1537]> then\n                        if <touching (portal v)?> then\n                            set [exit v] to [win]\n                        end\n                    end\n                else\n                    if <(LEVEL) = [6]> then\n                        if <(x) > [1844]> then\n                            if <touching (portal v)?> then\n                                set [exit v] to [win]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [reset v]\nhide\ngo to [front v] layer\ngo [backward v] (1) layers\n\ndefine Game win\nhide\nchange [level v] by (1)\n\nif <(SCROLL X) > [720]> then\n    set [scroll x v] to [720]\nend\n\nif <(LEVEL) = [1]> then\n    if <(SCROLL X) > [720]> then\n        set [scroll x v] to [720]\n    end\nend\n\n@Level\n\ndefine Clone at x: (x) y: (y)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\nshow\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\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 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [600] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [360] y: [0]\n                Clone at x: [510] y: [0]\n                Clone at x: [450] y: [180]\n                Clone at x: [600] y: [-160]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [360] y: [0]\n                    Clone at x: [450] y: [180]\n                    Clone at x: [650] y: [-165]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone at x: [360] y: [0]\n                        Clone at x: [550] y: [0]\n                        Clone at x: [500] y: [-100]\n                        Clone at x: [360] y: [100]\n                    else\n                        if <(LEVEL) = [7]> then\n                            switch costume to (level 7 1 v)\n                        end\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\nwhen flag clicked\nwait (.3) seconds\ngo to [front v] layer\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (level 1 1 v)\n\n@Danger\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]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\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 3 1 v)\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                    Clone at x: [0] y: [50]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone at x: [360] y: [0]\n                        Clone at x: [550] y: [0]\n                        Clone at x: [500] y: [-100]\n                        Clone at x: [360] y: [100]\n                    else\n                        if <(LEVEL) = [7]> then\n                            switch costume to (level 7 1 v)\n                        end\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\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\n\nClone at x: [360] y: [0]\n\n@Sprite1\n\n@Sprite2\n\nwhen flag clicked\ngo to [back v] layer\nset [ghost v] effect to (60)\n\n@Portal\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]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 1 v)\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 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [600] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 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: [840] y: [20]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [360] y: [0]\n                    Clone at x: [450] y: [180]\n                    Clone at x: [650] y: [-165]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone at x: [360] y: [0]\n                        Clone at x: [550] y: [0]\n                        Clone at x: [500] y: [-100]\n                        Clone at x: [360] y: [100]\n                    else\n                        if <(LEVEL) = [7]> then\n                            switch costume to (level 7 1 v)\n                        end\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\nwhen flag clicked\n\nwhen I start as a clone\nwait (.2) seconds\ngo to [front v] layer\n\nwhen I receive [reset v]\nwait (.5) seconds\ngo to [front v] layer\n\n@Portal2\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]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 1 v)\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 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [600] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 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: [840] y: [20]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [360] y: [0]\n                    Clone at x: [450] y: [180]\n                    Clone at x: [650] y: [-165]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone at x: [360] y: [0]\n                        Clone at x: [550] y: [0]\n                        Clone at x: [500] y: [-100]\n                        Clone at x: [360] y: [100]\n                    else\n                        if <(LEVEL) = [7]> then\n                            switch costume to (level 7 1 v)\n                        end\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\nwhen flag clicked\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (2) layers\n\nwait (.1) seconds\n\nwhen I receive [reset v]\ngo to [back v] layer\ngo [forward v] (2) layers\n\nwait (.1) seconds\n\nClone at x: [600] y: [0]\nClone at x: [1918] y: [-160]\n\n@maybe use dump\n\n@Thumbnail\n\nwhen [timer v] > (timer)\ngo to [front v] layer\nset [pixelate v] effect to (100)\nshow\nrepeat (20)\n    change [pixelate v] effect by (-5)\nend\n\nwhen flag clicked\nforever\n    hide\nend\n\nwhen flag clicked\nforever\n    hide\n    set [timer v] to (timer)\nend\n\n@Sprite3\n\nwhen flag clicked\nplay sound [Asher Fulero - Night Snow \(Calm\)2 v] until done\nbroadcast (song over v)\n\nwhen I receive [song over v]\nplay sound [Asher Fulero - Night Snow \(Calm\)2 v] until done\nbroadcast (song over v)\n\n@Sigma\n\n@Cloud\n\nwhen flag clicked\nif <(username) = (username)> then\n    set [☁ viewed v] to [1]\nend\n\n