cubed - a platformer [demo]

Instructions: A,D to move and W to jump or arrow keys :D\n\n#games

@Stage\n\nwhen [m v] key pressed\n\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\n\n@Blank\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Intro v)\n\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\nset [deaths: v] to [0]\n\nwhen I receive [play game v]\nset [easter egg costume switch v] to [1]\nset [level: v] to (Start level)\nforever\n    broadcast (RESET v)\n    broadcast (Set up v)\n    Game On\n    repeat until <(EXIT) > [50]>\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\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [speed y v] to [0]\nset [sx v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nif <<<mouse down?> and <(mouse x) < [0]>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    point in direction (90)\n    change [sx v] by (-3)\nend\nif <<<mouse down?> and <(mouse x) > [0]>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    point in direction (-90)\n    change [sx v] by (3)\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 <<<mouse down?> and <(mouse y) > [0]>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    if <(In air) < [4]> then\n        set [speed y v] to [16]\n    end\nend\nif <(Speed y) > [-15]> then\n    change [speed y v] by (-2)\nend\nChange Player y by (Speed y)\nTest - die\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\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\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\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 [speed y v] to [0]\nend\n\ndefine Change Player X by (sx)\nchange [x v] by (sx)\nPosition\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 <<<mouse down?> and <(mouse y) > [0]>> or <<key (up arrow v) pressed?> or <key (w 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 Game - Die\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\nchange [deaths: v] by (1)\n\ndefine Test - die\nif <touching (danger\( lava spikes etc\) v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - win\nset rotation style [all around v]\nrepeat (50)\n    point towards (exit portal v)\n    turn right (65) degrees\n    move ((distance to [exit portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nset rotation style [left-right v]\nhide\nif <(Level:) < [6]> then\n    change [level: v] by (1)\n    wait (1) seconds\nelse\n    set [level: v] to [bonus]\nend\n\nwhen flag clicked\nforever\n    if <<<mouse down?> and <(mouse y) < [-100]>> or <<key (down arrow v) pressed?> or <key (s v) pressed?>>> then\n        switch costume to (2 duck v)\n    end\n    if <not <<<mouse down?> and <(mouse y) < [-100]>> or <<key (down arrow v) pressed?> or <key (s v) pressed?>>>> then\n        switch costume to (easter egg costume switch)\n        if <touching (pirates flag \(easter egg\) v)?> then\n            set [easter egg costume switch v] to [2]\n        end\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <touching (statue v)?> then\n        think [What an odd looking man] for (4) seconds\n    end\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\n@Platform\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\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: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\nelse\n    if <(Level:) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n    else\n        if <(Level:) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [550] y: [0]\n            Clone at x: [0] y: [-250]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [400] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [250] y: [250]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n        else\n            if <(Level:) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n            else\n                if <(Level:) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [0] y: [450]\n                    Clone at x: [650] y: [-450]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [750] y: [0]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [-1300] y: [400]\n                    Clone at x: [300] y: [100]\n                    Clone at x: [300] y: [-100]\n                    Clone at x: [1350] y: [-400]\n                    Clone at x: [450] y: [0]\n                else\n                    if <(Level:) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                    else\n                        if <(Level:) = [bonus]> then\n                            switch costume to (level bonus 1 v)\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\n                            Clone at x: [450] y: [0]\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\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\n@danger( lava spikes etc)\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\ngo to [back v] layer\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: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\nelse\n    if <(Level:) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n    else\n        if <(Level:) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [550] y: [0]\n            Clone at x: [0] y: [-250]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n        else\n            if <(Level:) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n            else\n                if <(Level:) = [5]> then\n                    go to [front v] layer\n                    switch costume to (level 5 1 v)\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [100] y: [100]\n                    Clone at x: [500] y: [0]\n                    Clone at x: [500] y: [0]\n                    Clone at x: [700] y: [-100]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                else\n                    if <(Level:) = [6]> then\n                        go to [back v] layer\n                        switch costume to (level 6 1 v)\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                    else\n                        if <(Level:) = [bonus]> then\n                            switch costume to (level bonus 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\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\n@Text & fake objects\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\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: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\nelse\n    if <(Level:) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [250]\n        Clone at x: [450] y: [-250]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n        Clone at x: [450] y: [0]\n    else\n        if <(Level:) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [350]\n            Clone at x: [550] y: [350]\n            Clone at x: [0] y: [-700]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [0] y: [250]\n            Clone at x: [400] y: [0]\n            Clone at x: [0] y: [250]\n            Clone at x: [250] y: [250]\n            Clone at x: [450] y: [0]\n            Clone at x: [450] y: [0]\n        else\n            if <(Level:) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n                Clone at x: [450] y: [0]\n            else\n                if <(Level:) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [0] y: [600]\n                    Clone at x: [650] y: [-600]\n                    Clone at x: [550] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [450] y: [0]\n                    Clone at x: [550] y: [0]\n                else\n                    if <(Level:) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                        Clone at x: [450] y: [0]\n                    else\n                        if <(Level:) = [bonus]> then\n                            switch costume to (level bonus 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\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\n@exit portal\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [name v]) = [open]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level:) = [1]> then\n    switch costume to (open v)\n    Clone at x: [3335] y: [-35]\nelse\n    if <(Level:) = [2]> then\n        Clone at x: [3335] y: [-35]\n    else\n        if <(Level:) = [3]> then\n            Clone at x: [4045] y: [2010]\n        else\n            if <(Level:) = [4]> then\n                Clone at x: [4730] y: [-35]\n            else\n                if <(Level:) = [5]> then\n                    Clone at x: [6170] y: [-20]\n                else\n                    if <(Level:) = [6]> then\n                        Clone at x: [4739] y: [-20]\n                    else\n                        if <(Level:) = [bonus]> then\n                            Clone at x: [4739] y: [-20]\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\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\n@clouds\n\nwhen flag clicked\nchange [ghost v] effect by (15)\nhide\nforever\n    create clone of (_myself_ v)\n    wait (2) seconds\n    create clone of (_myself_ v)\n    wait (6) seconds\nend\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (3))\ngo to x: (300) y: (pick random (195) to (125))\nshow\nrepeat until <(x position) < [-250]>\n    change x by (-3)\nend\nrepeat (5)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@Intro p:1\n\nwhen I receive [intro v]\nshow\nset size to (100) %\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nwait (0.1) seconds\nswitch costume to (costume2 v)\nwait (0.1) seconds\nswitch costume to (costume5 v)\nwait (0.1) seconds\nswitch costume to (costume6 v)\nwait (0.1) seconds\nswitch costume to (costume7 v)\nwait (0.1) seconds\nswitch costume to (costume8 v)\nwait (0.1) seconds\nswitch costume to (costume3 v)\nwait (3) seconds\nrepeat (2)\n    switch costume to (costume9 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume4 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume10 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume11 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume12 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume13 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume14 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume15 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume16 v)\n    wait (0.1) seconds\n    change size by (-5)\n    switch costume to (costume17 v)\n    wait (0.1) seconds\n    change size by (-5)\nend\nhide\nbroadcast (Start screen v)\n\nwhen I receive [intro v]\nstart sound [Outro music v]\n\n@Intro p:2\n\nwhen I receive [intro v]\nhide variable [level: v]\nhide variable [deaths: v]\nshow\n\nwhen I receive [start screen v]\nhide\n\n@Start screen\n\ngo to x: (0) y: (0)\n\nwhen I receive [intro v]\nhide\n\nwhen I receive [start screen v]\nshow\n\nwhen I receive [play game v]\nhide\n\n@play game\n\nwhen I receive [start screen v]\nshow\nset [start level v] to [1]\ngo to x: (8) y: (75)\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\n\nwait (0.1) seconds\nswitch costume to (costume3 v)\nwait (0.1) seconds\nswitch costume to (costume2 v)\nwait (0.1) seconds\nswitch costume to (costume4 v)\nwait (0.1) seconds\n\nwhen I receive [intro v]\nhide\n\nwhen this sprite clicked\nhide\nbroadcast (Play Game v) and wait\n\nwhen I receive [level select v]\nhide\n\nwhen I receive [play game v]\nshow variable [deaths: v]\nshow variable [level: v]\n\n@Level select start\n\nwhen I receive [start screen v]\nshow\ngo to x: (8) y: (11)\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\n\nwait (0.1) seconds\nswitch costume to (costume3 v)\nwait (0.1) seconds\nswitch costume to (costume2 v)\nwait (0.1) seconds\nswitch costume to (costume4 v)\nwait (0.1) seconds\n\nwhen I receive [intro v]\nhide\n\nwhen this sprite clicked\nhide\nbroadcast (Level select v) and wait\n\nwhen I receive [play game v]\nhide\n\n@grey tint\n\ngo to [front v] layer\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\nshow\nset [ghost v] effect to (25)\n\nchange [ghost v] effect by (25)\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\nshow\nset [ghost v] effect to (25)\n\nwhen I receive [pause game v]\nshow\nset [ghost v] effect to (25)\n\n@select level to play\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\ngo to [front v] layer\nshow\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\n\n@level 1 select\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\nshow\n\nwhen this sprite clicked\nset [start level v] to [1]\nbroadcast (Play Game v)\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [level select v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\n@Sprite6\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\nshow\n\nwhen this sprite clicked\nset [start level v] to [2]\nbroadcast (Play Game v)\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [level select v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\n@level 2 select\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\nshow\n\nwhen this sprite clicked\nset [start level v] to [3]\nbroadcast (Play Game v)\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [level select v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\n@level 4 select\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\nshow\n\nwhen this sprite clicked\nset [start level v] to [4]\nbroadcast (Play Game v)\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [level select v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\n@level 5 select\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\nshow\n\nwhen this sprite clicked\nset [start level v] to [5]\nbroadcast (Play Game v)\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [level select v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\n@Level 6 select\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level select v]\nshow\n\nwhen this sprite clicked\nset [start level v] to [6]\nbroadcast (Play Game v)\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [level select v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian2 v)\n        wait (0.1) seconds\n        switch costume to (1 mian v)\n        wait (0.1) seconds\n        switch costume to (1 mian3 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (1 mian v)\n    end\nend\n\n@Pirates flag (easter egg)\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nif <(Level:) = [5]> then\n    Position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nend\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level:) = [1]> then\n    hide\nelse\n    if <(Level:) = [5]> then\n        switch costume to (piarte flag v)\n        Clone at x: [740] y: [610]\n    end\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\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\n@Pause\n\nwhen I receive [green flag v]\ngo to [front v] layer\nhide\n\nwhen I receive [play game v]\ngo to [front v] layer\nshow\n\nhide\n\nwhen this sprite clicked\ngo to [front v] layer\nhide\nbroadcast (Pause game v)\n\nbroadcast (level select in game v)\n\nwhen I receive [back v]\ngo to [front v] layer\nshow\n\n@Back\n\nwhen I receive [green flag v]\nhide\n\nwhen this sprite clicked\nhide\nbroadcast (Back v)\n\nwhen I receive [level select v]\nhide\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [pause game v]\ngo to [front v] layer\nshow\n\nwhen I receive [pause game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume1 v)\n        wait (0.1) seconds\n        switch costume to (costume3 v)\n        wait (0.1) seconds\n        switch costume to (costume1 v)\n        wait (0.1) seconds\n        switch costume to (costume4 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [level select in game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume1 v)\n        wait (0.1) seconds\n        switch costume to (costume3 v)\n        wait (0.1) seconds\n        switch costume to (costume1 v)\n        wait (0.1) seconds\n        switch costume to (costume4 v)\n        wait (0.1) seconds\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\n\n@music\n\nwhen I receive [green flag v]\nset volume to (100) %\nhide\n\nwhen I receive [play game v]\nstop all sounds\nforever\n    wait (3) seconds\n    play sound [Tobu - Candyland v] until done\nend\n\nwhen I receive [start screen v]\nstop all sounds\nwait (1) seconds\nstart sound [Elevator Music v]\n\nwhen I receive [the end v]\nstop all sounds\n\nforever\n    play sound [AVENGERS ENDGAME-whiteout12 v] until done\nend\n\nwhen I receive [set up v]\nif <(Level:) = [bonus]> then\n    stop all sounds\n    stop [other scripts in sprite v]\n    broadcast (bonus level music v) and wait\nend\n\nwhen I receive [play game v]\nshow\nset size to (30) %\ngo to x: (-185) y: (160)\nforever\n    if <(Mute?) = [no]> then\n        switch costume to (costume1 v)\n        set volume to (100) %\n    else\n        switch costume to (costume2 v)\n        set volume to (0) %\n    end\nend\n\nwhen this sprite clicked\nif <(Mute?) = [yes]> then\n    set [mute? v] to [no]\nelse\n    set [mute? v] to [yes]\nend\n\nwait (1) seconds\nplay sound [AVENGERS ENDGAME-whiteout12 v] until done\n\n@RESET\n\nwhen this sprite clicked\nhide\nset [start level v] to (Level:)\nbroadcast (Play Game v)\n\nwhen I receive [level select in game v]\nhide\n\nwhen I receive [pause game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [back v]\nhide\n\n@in game level select\n\nwhen this sprite clicked\nhide\nbroadcast (level select in game v)\n\nwhen I receive [back v]\nhide\n\nwhen I receive [level select in game v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [pause game v]\ngo to [front v] layer\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (costume1 v)\n    end\nend\n\n@Settings\n\nwhen I receive [pause game v]\ngo to [front v] layer\nshow\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [level select in game v]\nhide\n\nwhen I receive [back v]\nhide\n\n@statue\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [name v]) = [open]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [set up v]\nif <(Level:) = [6]> then\n    hide\n    set [x v] to [0]\n    set [y v] to [0]\n    if <(Level:) = [6]> then\n        show\n        switch costume to (closed v)\n        Clone at x: [1804] y: [-25]\n    else\n        hide\n        switch costume to (closed2 v)\n    end\nelse\n    hide\n    switch costume to (closed2 v)\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)\nif <(Level:) = [6]> then\n    set [x v] to (x)\n    set [y v] to (y)\nelse\n    hide\n    go to x: (-300) y: (300)\nend\n\nwhen I receive [bonus level music v]\nforever\n    wait (2) seconds\n    play sound [F-777 - The Seven Seas v] until done\nend\n\n@Thumb nail!\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\n\ngo to [front v] layer\nset [ghost v] effect to (0)\nshow\n\n