Crystal City Platformer v3.8.3 (UPDATE)

Instructions: Use arrow keys or wasd keys to move you\nfirst, you have to go up.\nif you want to go out of the shop, press d or right arrow key. If you want to finish the platformer, you have to go to scene 14.\nFLAG IS THE CHECKPOINT.

@Stage\n\nwhen flag clicked\nswitch backdrop to (back v)\n\n@Sprite1\n\nwhen flag clicked\nbroadcast (main menu v)\n\ndefine move-in steps (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last val v] to (x position)\n    change x by ((speed x) / (steps))\n    check touching solid\n    if <(touching) > [0]> then\n        Collid X-Slope or wall?\n    end\n    set [last val v] to (y position)\n    change y by ((speed Y) / (steps))\n    check touching solid\n    if <(touching) > [0]> then\n        Collid Y- Celiling or Floor\n    end\nend\n\ndefine check touching solid\nif <<touching (sprite2 v)?> or <<touching (sprite9 v)?> or <touching (sprite3 v)?>>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick-player v]\nswitch backdrop to <touching (sprite2 v)?>\ncontrols- up and down\ncontrols-left and right\nmove-in steps (([abs v] of (speed x) ) + ([abs v] of (speed Y) ))\nset costume\n\ndefine controls- up and down\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <(Stick Y) > [0.5]>>> then\n    if <<(wall slide) > [0]> and <(jumping) = [0]>> then\n        start sound [Jump v]\n        set [jumping v] to [1]\n        set [falling v] to [3]\n        set [wall slide v] to [0]\n        turn right (180) degrees\n        set [speed x v] to (((direction) / (90)) * (7))\n        set [long jump v] to [12]\n    end\n    if <<(falling) < [3]> and <(jumping) = [0]>> then\n        start sound [Jump v]\n        set [jumping v] to [1]\n        set [falling v] to [3]\n    end\n    if <<(jumping) > [0]> and <(jumping) < (jump duration)>> then\n        change [jumping v] by (1)\n        set [speed y v] to (jump force)\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [speed y v] by (gravity)\nif <(wall slide) > [0]> then\n    Check can wall slide\n    if <(speed Y) < [0]> then\n        set [speed y v] to ((speed Y) * (0.6))\n    end\nend\n\ndefine controls-left and right\nif <(long jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [key x v] to (<<<key (right arrow v) pressed?> or <(Stick X) > [0.5]>> or <key (d v) pressed?>> - <<<key (left arrow v) pressed?> or <(Stick X) < [-0.5]>> or <key (a v) pressed?>>)\nif <(Key X) = [0]> then\n    if <<(falling) > [2]> and <(wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.98))\n        stop [this script v]\n    end\n    if <([abs v] of (speed x) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed x v] by ((Key X) * (accel))\n    point in direction ((Key X) * (90))\n    change [frame v] by (1)\nend\nset [speed x v] to ((speed x) * (resis))\n\ndefine reset and bigin level\nset [invulnrable v] to [0]\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling v] to [99]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\npoint in direction (90)\nbigin scene # (spawn scene) go to x,y: (spawn x) (spawn y)\n\nwhen I receive [game loop v]\nset [ghost v] effect to (0)\nforever\n    broadcast (tick-first v)\n    broadcast (tick-player v)\n    broadcast (tick-last v)\nend\n\nwhen I receive [tick-last v]\nif <(x position) > [235]> then\n    bigin scene # ((scene #) + (1)) go to x,y: [-235] []\nend\nif <(x position) < [-235]> then\n    bigin scene # ((scene #) + (-1)) go to x,y: [235] []\nend\nif <(y position) > [180]> then\n    bigin scene # ((scene #) + (100)) go to x,y: [] [-160]\nend\nif <(y position) < [-180]> then\n    bigin scene # ((scene #) + (-100)) go to x,y: [] [180]\nend\nif <touching (daner v)?> then\n    broadcast (lose life v)\nend\n\ndefine bigin scene # (scene #) go to x,y: (x) (y)\nset [scene # v] to (scene #)\nif <(x) > []> then\n    set x to (x)\nend\nif <(y) > []> then\n    set y to (y)\nend\nbroadcast (about to change scene v)\nbroadcast (chang Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (big hitbox17 v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    Fix Collis in dire [0]\nelse\n    Fix Collis in dire [90]\nend\nset costume\nbroadcast (game loop v)\n\ndefine Fix Collis in dire (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    check touching solid\n    if <(touching) < [1]> then\n        point in direction (temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\nwhen I receive [tick-first v]\nswitch costume to (big hitbox17 v)\nset rotation style [don't rotate v]\n\ndefine set costume\nset rotation style [left-right v]\nif <(wall slide) > [0]> then\n    switch costume to (hagn v)\n    stop [this script v]\nend\nif <(falling) > [1]> then\n    if <(speed Y) > [0]> then\n        switch costume to (jump v)\n    else\n        switch costume to (jump2 v)\n    end\n    stop [this script v]\nend\nif <(frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((frame) mod (15)) ))\nelse\n    switch costume to (big hitbox2 v)\nend\n\ndefine Collid X-Slope or wall?\nCheck can wall slide\nchange y by (1)\ncheck touching solid\nif <(touching) > [0]> then\n    change y by (1)\n    check touching solid\n    if <(touching) > [0]> then\n        change y by (-2)\n        set x to (last val)\n        set [speed x v] to [0]\n        stop [this script v]\n    end\n    set [speed x v] to ((speed x) * (0.8))\nend\nset [speed x v] to ((speed x) * (0.95))\nSlip\n\ndefine Collid Y- Celiling or Floor\nset y to (last val)\nif <(speed Y) > [0]> then\n    set [speed y v] to [0]\n    stop [this script v]\nend\nif <(falling) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed y v] to ((speed Y) * (0.8))\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\ncheck touching solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\ncheck touching solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\ndefine Check can wall slide\nif <(falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (big hitbox wall slide v)\nset rotation style [left-right v]\ncheck touching solid\nset [wall slide v] to (touching)\nswitch costume to (big hitbox17 v)\nset rotation style [don't rotate v]\n\nwhen I receive [lose life v]\nchange [☁ all died v] by (1)\nset [invulnrable v] to [1]\nstop [other scripts in sprite v]\nstart sound [Oops v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nchange [lives v] by (-1)\nif <(Lives) > [0]> then\n    reset and bigin level\nelse\n    change [☁ all lose v] by (1)\n    broadcast (Game Over v)\nend\n\nwhen I receive [start game v]\nset [gravity v] to [-1.5]\nset [accel v] to [1.5]\nset [jump force v] to [12]\nset [jump duration v] to [6]\nset [resis v] to [0.8]\nbroadcast (reset game v) and wait\nbroadcast (setup v) and wait\nset [lives v] to [3]\nset [spawn scene v] to [1]\nset [spawn x v] to [-207]\nset [spawn y v] to [109]\nreset and bigin level\n\nwhen I receive [player-bounce v]\nset [speed y v] to [10]\n\nwhen flag clicked\nforever\n    if <(username) = [POTATO_IS_VERY_COOL]> then\n        hide\n    else\n        show\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (36) y: (28)\ngo to [back v] layer\n\nwhen I receive [chang scene v]\nswitch costume to (join [Scene] (scene #))\n\nwhen flag clicked\nforever\n    if <(username) = [POTATO_IS_VERY_COOL]> then\n        hide\n    else\n        show\n    end\nend\n\n@daner\n\nwhen flag clicked\ngo to x: (36) y: (28)\ngo to [back v] layer\n\nwhen I receive [chang scene v]\ngo to x: (36) y: (28)\nswitch costume to (blank v)\nswitch costume to (join [Scene] (scene #))\nif <(scene #) = [102]> then\n    forever\n        set y to ((3) * ([sin v] of ((timer) * (250)) ))\n    end\nend\nif <(scene #) = [3]> then\n    forever\n        set y to ((3) * ([sin v] of ((timer) * (250)) ))\n    end\nend\nif <(scene #) = [103]> then\n    forever\n        set y to ((3) * ([sin v] of ((timer) * (250)) ))\n    end\nend\nif <(scene #) = [6]> then\n    forever\n        set y to ((3) * ([sin v] of ((timer) * (250)) ))\n    end\nend\nif <(scene #) = [10]> then\n    forever\n        set y to ((3) * ([sin v] of ((timer) * (250)) ))\n    end\nend\n\nwhen flag clicked\nforever\n    if <(username) = [POTATO_IS_VERY_COOL]> then\n        hide\n    else\n        show\n    end\nend\n\n@ollectabie\n\nwhen I receive [chang scene v]\nif <(scene #) = (my scene)> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nrepeat until <touching (sprite1 v)?>\n    change y by ((0.5) * ([sin v] of (frame) ))\n    change [frame v] by (5)\nend\nset [my scene v] to []\nif <(costume [name v]) = [crystal]> then\n    start sound [Magic Spell v]\n    change [crystals v] by (1)\nelse\n    if <(costume [name v]) = [Green Flag]> then\n        start sound [Connect v]\n        set [spawn scene v] to (scene #)\n        set [spawn x v] to ([x position v] of [sprite1 v])\n        set [spawn y v] to ([y position v] of [sprite1 v])\n    else\n        if <(costume [name v]) = [health]> then\n            start sound [Coin v]\n            change [lives v] by (1)\n        else\n            start sound [Wand v]\n            add (costume [name v]) to [colleted v]\n        end\n    end\nend\nrepeat (20)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [setup v]\ndelete all of [colleted v]\nset [frame v] to [0]\nset [crystals v] to [0]\nhide\nplace [crystal] scene [1] xy [214] [45]\nplace [crystal] scene [101] xy [-83] [-49]\nplace [crystal] scene [101] xy [217] [121]\nplace [crystal] scene [2] xy [159] [119]\nplace [crystal] scene [102] xy [-111] [63]\nplace [crystal] scene [102] xy [105] [-46]\nplace [crystal] scene [102] xy [234] [-124]\nplace [Key 1] scene [101] xy [52] [52]\nplace [crystal big] scene [5] xy [166] [36]\nplace [Green Flag] scene [2] xy [69] [45]\nplace [Green Flag] scene [3] xy [96] [118]\nplace [Green Flag] scene [101] xy [-15] [6]\nplace [crystal] scene [4] xy [38] [124]\nplace [crystal] scene [4] xy [188] [69]\nplace [Green Flag] scene [5] xy [-190] [15]\nplace [Green Flag] scene [6] xy [-190] [15]\nplace [Green Flag] scene [106] xy [147] [-139]\nplace [crystal] scene [8] xy [-41] [21]\nplace [crystal] scene [8] xy [165] [21]\nplace [crystal] scene [107] xy [-112] [-86]\nplace [Green Flag] scene [8] xy [-176] [35]\nplace [Green Flag] scene [9] xy [-176] [35]\nplace [crystal] scene [9] xy [199] [24]\nplace [Green Flag] scene [10] xy [-141] [71]\nplace [crystal] scene [10] xy [189] [37]\nplace [crystal] scene [11] xy [161] [24]\nplace [crystal] scene [11] xy [-53] [24]\nplace [Green Flag] scene [12] xy [-176] [35]\nplace [crystal] scene [12] xy [76] [24]\nplace [crystal] scene [13] xy [137] [24]\nplace [crystal] scene [13] xy [-92] [24]\nplace [health] scene [101] xy [164] [113]\nplace [health] scene [2] xy [-208] [63]\nplace [health] scene [4] xy [-91] [67]\nplace [health] scene [6] xy [-5] [67]\nplace [health] scene [8] xy [71] [24]\nplace [health] scene [10] xy [67] [100]\nplace [health] scene [12] xy [175] [24]\nplace [crystal] scene [103] xy [153] [-58]\n\ndefine place (costume name) scene (scene) xy (x) (y)\nset [my scene v] to (scene)\nswitch costume to (costume name)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [my scene v] to []\n\nwhen I receive [reset game v]\ndelete this clone\n\n@Sprite3\n\nwhen I receive [chang scene v]\nswitch costume to (key 1 v)\ngo to [back v] layer\nhide\nif <(scene #) = [3]> then\n    door at [-95] [29] key [Key 1]\nend\n\ndefine door at (x) (y) key (key name)\nshow\nswitch costume to (key name)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (sprite1 v)?>\n    if <[colleted v] contains (key name)?> then\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (-4)\n        end\n        start sound [Crunch v]\n    else\n        start sound [Low Squeak v]\n    end\n    wait until <not <touching (sprite1 v)?>>\nend\n\n@splash screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (main menu v)\ngo to [front v] layer\nshow\n\nwhen I receive [game over v]\ngo to [front v] layer\ngo to x: (0) y: (0)\nswitch costume to (game over v)\nshow\nbroadcast (main menu v)\n\nwhen I receive [start game v]\nhide\n\n@enemy\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [chang scene v]\nif <(scene #) = [2]> then\n    if <([x position v] of [sprite1 v]) < [3]> then\n        spawn [G.] at [121] [-3] dir [-90]\n    else\n        spawn [G.] at [131] [5] dir [90]\n    end\nend\n\nwhen I start as a clone\nshow\nset [speed y v] to [0]\nset [frame v] to [0]\nforever\n    switch costume to (g.1 v)\n    set rotation style [don't rotate v]\n    move-left or right\n    move-down\n    change [frame v] by (0.33)\n    switch costume to ((1) + (([floor v] of (frame) ) mod (4)))\n    set rotation style [left-right v]\n    if <<(invulnrable) = [0]> and <touching (sprite1 v)?>> then\n        touching player\n    end\nend\n\nwhen I receive [about to change scene v]\ndelete this clone\n\ndefine move-down\nchange [speed y v] by (-1)\nchange y by (speed y)\nrepeat until <not <touching (sprite2 v)?>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\ndefine move-left or right\nmove (2) steps\nrepeat (4)\n    if <not <<touching (sprite2 v)?> or <touching (_edge_ v)?>>> then\n        if <not <touching (safe v)?>> then\n            stop [this script v]\n        end\n    end\n    change y by (1)\nend\nchange y by (-4)\nmove (-2) steps\nturn right (180) degrees\n\ndefine touching player\nif <([speed y v] of [sprite1 v]) < [-3]> then\n    broadcast (player-bounce v)\n    start sound [Squish Pop v]\n    switch costume to (g.x v)\n    wait (0.3) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nbroadcast (lose life v)\n\ndefine spawn (type) at (x) (y) dir (dir)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\n@main menu3\n\nwhen I receive [main menu v]\nswitch costume to (play button2 v)\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\ngo to x: (61) y: (-109)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen this sprite clicked\nbroadcast (joystick v)\nset [lives v] to [3]\nhide\nbroadcast (start game v)\n\nwhen flag clicked\nhide\n\nwhen I receive [immobile v]\nhide\n\n@enemy2\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [chang scene v]\nif <(scene #) = [4]> then\n    if <([x position v] of [sprite1 v]) < [1]> then\n        spawn [G.] at [14] [-18] dir [90]\n    else\n        spawn [G.] at [14] [-18] dir [90]\n    end\nend\n\nwhen I start as a clone\nshow\nset [speed y v] to [0]\nset [frame v] to [0]\nforever\n    switch costume to (g.1 v)\n    set rotation style [don't rotate v]\n    move-left or right\n    move-down\n    change [frame v] by (0.33)\n    switch costume to ((1) + (([floor v] of (frame) ) mod (4)))\n    set rotation style [left-right v]\n    if <<(invulnrable) = [0]> and <touching (sprite1 v)?>> then\n        touching player\n    end\nend\n\nwhen I receive [about to change scene v]\ndelete this clone\n\ndefine move-down\nchange [speed y v] by (-1)\nchange y by (speed y)\nrepeat until <not <touching (sprite2 v)?>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\ndefine move-left or right\nmove (2) steps\nrepeat (4)\n    if <not <<touching (sprite2 v)?> or <touching (_edge_ v)?>>> then\n        if <not <touching (safe v)?>> then\n            stop [this script v]\n        end\n    end\n    change y by (1)\nend\nchange y by (-4)\nmove (-2) steps\nturn right (180) degrees\n\ndefine touching player\nif <([speed y v] of [sprite1 v]) < [-3]> then\n    broadcast (player-bounce v)\n    start sound [Squish Pop v]\n    switch costume to (g.x v)\n    wait (0.3) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nbroadcast (lose life v)\n\ndefine spawn (type) at (x) (y) dir (dir)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\n@blank\n\n@Sprite5\n\nwhen flag clicked\ngo to x: (36) y: (28)\n\nwhen I receive [start game v]\nswitch costume to (costume1 v)\nsay [please lov & fav! AND follow!]\nwait (2) seconds\nsay [Hello!]\nwait (1) seconds\nsay [walcome to Crystal City Platformer.]\nwait (2) seconds\nsay [first, you have to go up.]\nwait (2) seconds\nsay []\nforever\n    switch costume to (costume2 v)\nend\n\nwhen flag clicked\nforever\n    if <(scene #) = [106]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nset volume to (100) %\nforever\n    play sound (pick random (1) to (3)) until done\nend\n\n@Sprite6\n\nwhen flag clicked\ngo to x: (-96) y: (-57)\nforever\n    if <(x position) < [0]> then\n        point in direction ((135) + (([sin v] of (i1) ) * (10)))\n        change [i1 v] by (4)\n    else\n        point in direction ((45) + (([sin v] of (i1) ) * (10)))\n        change [i1 v] by (4)\n    end\nend\n\n@Sprite7\n\nwhen flag clicked\nshow\ngo to x: (118) y: (-45)\nforever\n    if <(x position) < [0]> then\n        point in direction ((135) + (([sin v] of (i1) ) * (10)))\n        change [i1 v] by (4)\n    else\n        point in direction ((45) + (([sin v] of (i1) ) * (10)))\n        change [i1 v] by (4)\n    end\nend\n\n@Sprite8\n\nwhen flag clicked\nforever\n    go to (sprite1 v)\n    change y by (25)\n    if <(scene #) = [1]> then\n        switch costume to (lv.0 v)\n    else\n        if <(scene #) = [101]> then\n            switch costume to (lv.1 v)\n        else\n            if <(scene #) = [102]> then\n                switch costume to (lv.2 v)\n            else\n                if <(scene #) = [2]> then\n                    switch costume to (lv.3 v)\n                else\n                    if <(scene #) = [3]> then\n                        switch costume to (lv.4 v)\n                    else\n                        if <(scene #) = [4]> then\n                            switch costume to (lv.5 v)\n                        else\n                            if <(scene #) = [5]> then\n                                switch costume to (lv.6 v)\n                            else\n                                if <(scene #) = [6]> then\n                                    switch costume to (lv.7 v)\n                                else\n                                    if <(scene #) = [106]> then\n                                        switch costume to (lv.8 v)\n                                    else\n                                        if <(scene #) = [107]> then\n                                            switch costume to (lv.9 v)\n                                        else\n                                            if <(scene #) = [7]> then\n                                                switch costume to (lv.10 v)\n                                            else\n                                                if <(scene #) = [8]> then\n                                                    switch costume to (lv.11 v)\n                                                else\n                                                    if <(scene #) = [9]> then\n                                                        switch costume to (lv.12 v)\n                                                    else\n                                                        if <(scene #) = [10]> then\n                                                            switch costume to (lv.13 v)\n                                                        else\n                                                            if <(scene #) = [11]> then\n                                                                switch costume to (lv.14 v)\n                                                            else\n                                                                if <(scene #) = [12]> then\n                                                                    switch costume to (lv.15 v)\n                                                                else\n                                                                    if <(scene #) = [13]> then\n                                                                        switch costume to (lv.16 v)\n                                                                    else\n                                                                        if <(scene #) = [14]> then\n                                                                            switch costume to (lv.17 v)\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Sprite10\n\nwhen flag clicked\nhide\n\nwhen I receive [no shop v]\nhide\n\nwhen I receive [shop v]\ngo to x: (36) y: (28)\nshow\n\n@Sprite11\n\nwhen flag clicked\nforever\n    if <(scene #) = [2]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [back v] layer\n\n@Sprite12\n\nwhen flag clicked\nhide\nforever\n    if <(scene #) = [14]> then\n        go to x: (36) y: (28)\n        show\n    else\n        hide\n    end\nend\n\nwhen this sprite clicked\nchange [☁ all won v] by (1)\nforever\n    hide\nend\n\nwhen flag clicked\nset [time v] to [0]\n\nwhen I receive [start game v]\nset [time v] to [0]\nrepeat until <(scene #) = [14]>\n    change [time v] by (1)\n    wait (1) seconds\nend\nif <(☁ Fastest) > (Time)> then\n    set [☁ fastest v] to (Time)\nend\n\n@Sprite4\n\nwhen I receive [start game v]\nswitch costume to (off v)\ngo to [front v] layer\nshow\ngo to x: (-207) y: (147)\n\nwhen flag clicked\nhide variable [☁ all won v]\nhide variable [☁ all lose v]\nhide variable [☁ fastest v]\n\nwhen this sprite clicked\nif <(costume [number v]) = [2]> then\n    switch costume to (on v)\n    show variable [☁ all won v]\n    show variable [☁ all lose v]\n    show variable [☁ fastest v]\nelse\n    switch costume to (off v)\n    hide variable [☁ all won v]\n    hide variable [☁ all lose v]\n    hide variable [☁ fastest v]\nend\n\n@Sprite14\n\n@Sprite13\n\nwhen flag clicked\ngo to x: (169) y: (138)\ngo to [front v] layer\n\n@Control Stick\n\nwhen I start as a clone\nswitch costume to (stick v)\ngo [forward v] (1) layers\nset [ghost v] effect to (25)\nforever\n    set [stick power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (Myself)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) * (0.6))> then\n        Stick Drag\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\ndefine Stick Drag\nrepeat until <not <mouse down?>>\n    go to (mouse-pointer v)\n    point towards (Myself)\n    turn right (180) degrees\n    set [stick direction v] to (direction)\n    set [stick power v] to (distance to [(Myself) v])\n    if <(STICK POWER) > (max stick)> then\n        move ((max stick) - (STICK POWER)) steps\n        set [stick power v] to (max stick)\n    end\n    set [stick power v] to ((STICK POWER) / (max stick))\n    set [stick x v] to ((STICK POWER) * ([sin v] of (STICK DIRECTION) ))\n    set [stick y v] to ((STICK POWER) * ([cos v] of (STICK DIRECTION) ))\nend\n\nwhen I receive [joystick v]\nshow\ngo to x: (170) y: (-110)\nwait () seconds\ngo to [front v] layer\nset [myself v] to [Control Stick]\nset size to (140) %\nset [max stick v] to ((size) / (4))\nswitch costume to (base v)\nset [ghost v] effect to (60)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I receive [immobile v]\nhide\n\n@main menu2\n\nwhen I receive [main menu v]\nswitch costume to (play button v)\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\ngo to x: (-142) y: (-109)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen this sprite clicked\nbroadcast (immobile v)\nset [lives v] to [3]\nhide\nbroadcast (start game v)\n\nwhen flag clicked\nhide\n\nwhen I receive [joystick v]\nhide\n\n@Sprite15\n\nwhen this sprite clicked\n\nif <(answer) = [1353454551]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nwhen [space v] key pressed\n\nwhen [space v] key pressed\n\nwhen [space v] key pressed\n\nif <(answer) = [41145435]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nif <(answer) = [41145435]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nif <(answer) = [155145441]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nif <(answer) = [`324324343]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\nif <(answer) = [5413514]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nif <(answer) = [1433414115]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nwhen this sprite clicked\n\nwhen this sprite clicked\n\nwhen this sprite clicked\nask [What is the code?] and wait\nif <(answer) = [861843]> then\n    say [Correct!] for (3) seconds\n    change [lives v] by (10)\n    say [You received 10 lives!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nif <(answer) = [255675]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nif <(answer) = [12435141434]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\ngo to x: (-212) y: (90)\nshow\n\nif <(answer) = [76335614]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nif <(answer) = [14341345]> then\n    say [Correct!] for (3) seconds\nelse\n    say [Incorrect.] for (3) seconds\nend\n\nwhen this sprite clicked\n\n@engine\n\n@splash screen2\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.1)\nshow\ngo to [front v] layer\ngo to x: (0) y: (1000)\nrepeat (48)\n    change y by (((10) - (y position)) / (10))\nend\n\n@Sprite16\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen I receive [main menu v]\ngo to x: (-212) y: (-160)\nshow\n\nwhen this sprite clicked\nswitch costume to (costume2 v)\nbroadcast (Shop Open v)\n\nwhen [e v] key pressed\nswitch costume to (costume1 v)\nbroadcast (shop closed v)\n\n@Sprite17\n\nwhen flag clicked\nhide\n\nwhen I receive [shop open v]\nshow\ngo to x: (-213) y: (-143)\n\nwhen this sprite clicked\nif <<(Crystals) = [5]> or <(Crystals) > [5]>> then\n    start sound [Magic Spell v]\n    change [lives v] by (1)\n    change [crystals v] by (-5)\nelse\n    play sound [Wobble v] until done\nend\n\nwhen I receive [shop closed v]\nhide\n\n