Under - A Platformer
@Stage\n\nwhen flag clicked\nforever\n    if <([costume # v] of [mute button v]) = [2]> then\n        forever\n            stop all sounds\n            wait until <([costume # v] of [mute button v]) = [1]>\n            play sound [Intro Music v] until done\n            wait (0.1) seconds\n        end\n    end\n    if <key (right arrow v) pressed?> then\n        play sound [In Game Music v] until done\n        wait (0.1) seconds\n    else\n        play sound [Intro Music v] until done\n        wait (0.1) seconds\n    end\nend\n\nwhen flag clicked\nswitch backdrop to ( v)\nforever\n    if <<(Scene Num.) = [304]> or <(Scene Num.) = [303]>> then\n        switch backdrop to (2 v)\n    else\n        switch backdrop to ( v)\n    end\nend\n\n@Player\n\nwhen flag clicked\nbroadcast (Main Menu v)\n\ndefine MOOving (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((Speed x) / (steps))\n    Hmmm2...\n    if <(Touching) > [0]> then\n        X - / or ||\n    end\n    set [last value v] to (y position)\n    change y by ((Speed y) / (steps))\n    Hmmm2...\n    if <(Touching) > [0]> then\n        Y?\n    end\nend\n\ndefine Hmmm2...\nif <<touching (level v)?> or <touching (platforms v)?>> then\n    set [touching v] to [1]\n    stop [this script v]\nend\nset [touching v] to [0]\nset [hitbox costume? v] to (costume [name v])\nif <(Hitbox Costume?) = [Hitbox2]> then\n    switch costume to (hitbox feet v)\nend\nif <touching (water puddles v)?> then\n    if <(Water Puddle Jump) < [1]> then\n        change y by (-6)\n        if <(Hitbox Costume?) = [Hitbox2]> then\n            switch costume to (hitbox feet2 v)\n        end\n        if <touching (water puddles v)?> then\n            set [touching v] to [1]\n        else\n            set [water puddle jump v] to [1]\n        end\n        change y by (6)\n    end\nelse\n    set [water puddle jump v] to [0]\nend\nswitch costume to (Hitbox Costume?)\n\nwhen I receive [tick - player v]\nWOOO... Platform\nUp and Down Controls\n<Controls>\nMOOving (([abs v] of (Speed x) ) + ([abs v] of (Speed y) ))\n21\n\ndefine Up and Down Controls\nif <(Joystick Button) > [0]> then\n    if <<(Wall Slide) > [0]> and <(Jumping) = [0]>> then\n        start sound [Jumping Sound 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 [Jumping Sound 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    Hmmm...\n    if <(Speed y) < [0]> then\n        set [speed y v] to ((Speed y) * (0.6))\n    end\nend\n\ndefine <Controls>\nif <(LONG Jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [key x v] to (Stick X)\nif <([abs v] of (Key X) ) < [0.3]> then\n    if <<(Falling) > [2]> and <(Wall Slide) < [1]>> then\n        set [speed x v] to ((Speed x) * (0.95))\n        stop [this script v]\n    end\n    set [frame v] to [0]\nelse\n    change [speed x v] by ((Key X) * (Acceleration))\n    if <not <(direction) = ((Key X) * (90))>> then\n        set [wall slide v] to [0]\n    end\n    point in direction ((Key X) * (90))\n    change [frame v] by (0.3)\nend\nset [speed x v] to ((Speed x) * (Resistance))\n\ndefine Reset and Begin level\nset [inv. 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)\n0 (Spawn Scene) x, y: (Spawn X?) (Spawn Y?)\n\nwhen I receive [game loop v]\nset [color v] effect to (0)\nset [ghost v] effect to (0)\nforever\n    broadcast (Tick - First v)\n    broadcast (Tick - Platforms v)\n    broadcast (Tick - Player v)\n    broadcast (Tick - Last v)\n    set [color v] effect to (Skin)\nend\n\nwhen I receive [tick - last v]\nif <(x position) > [235]> then\n    0 ((Scene Num.) + (1)) x, y: [-235] []\nend\nif <(x position) < [-235]> then\n    0 ((Scene Num.) + (-1)) x, y: [235] []\nend\nif <(y position) > [180]> then\n    0 ((Scene Num.) + (100)) x, y: [] [-160]\nend\nif <(y position) < [-180]> then\n    0 ((Scene Num.) + (-100)) x, y: [] [180]\nend\nif <touching (obstacles v)?> then\n    broadcast (Life Lost! v)\nend\n\ndefine 0 (scene num) x, y: (x) (y)\nset [scene num. v] to (scene num)\nif <(x) > []> then\n    set x to (x)\nend\nif <(y) > []> then\n    set y to (y)\nend\nbroadcast (Exit Scene v)\nbroadcast (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox2 v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    Fix 1 [0]\nelse\n    Fix 1 [90]\nend\n21\nbroadcast (Game Loop v)\n\ndefine Fix 1 (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Hmmm2...\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 (hitbox2 v)\nset rotation style [don't rotate v]\nset [platform dx v] to []\nset [platform dy v] to []\n\ndefine 21\nset rotation style [left-right v]\nif <(Wall Slide) > [0]> then\n    switch costume to (wall slide v)\n    stop [this script v]\nend\nif <(Falling) > [1]> then\n    if <(Speed y) > [0]> then\n        switch costume to (jump up v)\n    else\n        switch costume to (jump down v)\n    end\n    stop [this script v]\nend\nif <(Frame) > [0]> then\n    switch costume to ([floor v] of ((1) + ((Frame) mod (14))) )\nelse\n    switch costume to (slope1 hitbox v)\n    repeat (3)\n        Hmmm2...\n        if <(Touching) < [1]> then\n            switch costume to ((costume [number v]) + (9))\n            stop [this script v]\n        end\n        next costume\n    end\n    switch costume to (run1 v)\nend\n\ndefine X - / or ||\nHmmm...\nchange y by (1)\nHmmm2...\nif <(Touching) > [0]> then\n    change y by (1)\n    Hmmm2...\n    if <(Touching) > [0]> then\n        change y by (-2)\n        set x to (Last Value)\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))\nWAAA\n\ndefine Y?\nset y to (Last Value)\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    WAAA\nend\nset [speed y v] to ((Speed y) * (0.8))\n\ndefine WAAA\nchange y by (-2)\nchange x by (1)\nHmmm2...\nif <(Touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (1)\nend\nchange x by (-2)\nHmmm2...\nif <(Touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (-1)\nend\nchange y by (2)\nchange x by (1)\n\ndefine Hmmm...\nif <(Falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (wall slide hitbox v)\nset rotation style [left-right v]\nHmmm2...\nset [wall slide v] to (Touching)\nswitch costume to (hitbox2 v)\nset rotation style [don't rotate v]\n\nwhen I receive [life lost! v]\nset [inv. v] to [1]\nstop [other scripts in sprite v]\nstart sound [Pew v]\nrepeat (10)\n    change [color v] effect by (25)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nchange [lives v] by (-1)\nif <(Lives) > [0]> then\n    Reset and Begin level\nelse\n    broadcast (Game Over! v)\nend\n\ndefine WOOO... Platform\nchange x by (Platform DX)\nchange y by (Platform DY)\nHmmm2...\nif <(Touching) > [0]> then\n    CLOSEST (x position) (y position) Max [16]\n    if <(Touching) > [0]> then\n        broadcast (Life Lost! v)\n    end\nend\n\ndefine CLOSEST (x) (y) Max (max)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (Distance) steps\n        Hmmm2...\n        if <(Touching) < [1]> then\n            point in direction (temp)\n            stop [this script v]\n        end\n        turn right (22.5) degrees\n    end\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (temp)\n\nwhen I receive [play again??? v]\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [jump duration v] to [5]\nset [acceleration v] to [2]\nset [resistance 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 [-195]\nset [spawn y? v] to [-63]\nReset and Begin level\n\nwhen I receive [bounce v]\nset [speed y v] to [8]\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (Scene Num.))\n\nwhen flag clicked\nforever\n    if <(Scene Num.) = [304]> then\n        if <([x position v] of [player v]) < [232]> then\n            set [scene num. v] to [303]\n            switch costume to (join [Scene] (Scene Num.))\n            change [sun particles v] by (10)\n        end\n    end\nend\n\n@Obstacles\n\nwhen flag clicked\ngo to x: (0) y: (0)\nrepeat (3)\n    go to [back v] layer\nend\n\nwhen I receive [change scene v]\ngo to x: (0) y: (0)\nswitch costume to (nothing v)\nswitch costume to (join [Scene] (Scene Num.))\nif <<<<<<(Scene Num.) = [2]> or <(Scene Num.) = [5]>> or <(Scene Num.) = [102]>> or <(Scene Num.) = [103]>> or <(Scene Num.) = [6]>> or <(Scene Num.) = [105]>> then\n    forever\n        set y to ((2) * ([sin v] of ((timer) * (180)) ))\n    end\nend\nif <(Scene Num.) = [104]> then\n    forever\n        set y to ((-63) * ([sin v] of ((timer) * (100)) ))\n    end\nend\nif <(Scene Num.) = [307]> then\n    forever\n        set y to ((150) * ([sin v] of ((timer) * (25)) ))\n    end\nend\nif <(Scene Num.) = [305]> then\n    wait (4) seconds\n    repeat until <not <(Scene Num.) = [305]>>\n        hide\n        go to (random position v)\n        broadcast (Warning! v)\n        wait (4.5) seconds\n    end\n    go to x: (0) y: (0)\nend\n\nwhen I receive [show v]\nshow\nwait (2) seconds\n\n@Platforms\n\nwhen I receive [change scene v]\nswitch costume to (costume1 v)\nhide\nif <(Scene Num.) = [2]> then\n    set size to (150) %\n    Spawn [JumpSpinner] at [50] [-52] Dir. [0] Turn [1]\n    Spawn [JumpSpinner] at [-60] [-52] Dir. [0] Turn [-1]\nend\nif <(Scene Num.) = [4]> then\n    set size to (300) %\n    Spawn [costume1] at [-26] [-26] Dir. [0] Turn []\nend\nif <(Scene Num.) = [7]> then\n    set size to (100) %\n    Spawn [WaterDroplet 1] at [-67] [-52] Dir. [90] Turn []\nend\nif <(Scene Num.) = [8]> then\n    set size to (100) %\n    Spawn [BIGcircle] at [78] [-110] Dir. [90] Turn [-10]\nend\nif <(Scene Num.) = [102]> then\n    set size to (120) %\n    Spawn [costume1] at [205] [-160] Dir. [90] Turn []\nend\nif <(Scene Num.) = [103]> then\n    set size to (100) %\n    Spawn [costume1] at [47] [-42] Dir. [90] Turn []\nend\nif <(Scene Num.) = [104]> then\n    set size to (500) %\n    Spawn [costume1] at [-123] [94] Dir. [90] Turn []\nend\nif <(Scene Num.) = [105]> then\n    set size to (120) %\n    Spawn [costume1] at [-36] [57] Dir. [90] Turn []\n    Spawn [costume1] at [124] [54] Dir. [90] Turn []\nend\nif <(Scene Num.) = [108]> then\n    set size to (100) %\n    Spawn [Tri-Pattern] at [-33] [134] Dir. [90] Turn [2]\n    Spawn [Tri-Pattern] at [-136] [35] Dir. [-90] Turn [1]\n    Spawn [Tri-Pattern] at [-23] [-27] Dir. [90] Turn [1]\nend\nif <(Scene Num.) = [208]> then\n    set size to (150) %\n    Spawn [WaterDroplet 2] at [-115] [119] Dir. [90] Turn []\nend\nif <(Scene Num.) = [308]> then\n    set size to (200) %\n    Spawn [JumpSpinner] at [1] [19] Dir. [0] Turn [-1]\n    Spawn [JumpSpinner] at [-111] [62] Dir. [0] Turn [-1]\nend\n\ndefine Move Platform\npoint in direction (90)\nforever\n    glide (1) secs to x: (47) y: (-45)\n    wait (0.5) seconds\n    glide (1) secs to x: (175) y: (-45)\n    wait (0.5) seconds\nend\n\nwhen I receive [tick - platforms v]\ntick (x position) (y position)\nset [last x v] to (x position)\nset [last y v] to (y position)\n\ndefine tick (x) (y)\nif <(Turn) > []> then\n    change y by (4)\n    if <touching (player v)?> then\n        Rotation Math ((0) - (Turn))\n    end\nelse\n    if <(y) > (Last y)> then\n        change y by (1)\n    else\n        set y to ((Last y) + (1))\n    end\n    if <touching (player v)?> then\n        set [platform dx v] to ((x) - (Last x))\n        set [platform dy v] to ((y) - (Last y))\n    end\nend\ngo to x: (x) y: (y)\n\ndefine Move Platform2\nshow\nforever\n    glide (1) secs to x: (x position) y: ((y position) + (139))\n    wait (0.5) seconds\n    glide (1) secs to x: (x position) y: ((y position) - (139))\n    wait (0.5) seconds\nend\n\ndefine Move Platform3\nforever\n    glide (1) secs to x: (205) y: (11)\n    wait (0.5) seconds\n    glide (1) secs to x: (205) y: (-160)\n    wait (0.5) seconds\nend\n\ndefine Move Platform4\nwait (5) seconds\nglide (50) secs to x: (-123) y: (-34)\n\ndefine Move Platform5\nforever\n    glide (1) secs to x: (x position) y: ((y position) - (58))\n    wait (0.5) seconds\n    glide (1) secs to x: (x position) y: ((y position) + (58))\n    wait (0.5) seconds\nend\n\ndefine WaterDroplet Blocker (x) (y) WaterDroplet (waterdroplet name)\ngo to x: (x) y: (y)\nset [ghost v] effect to (0)\nshow\nswitch costume to (waterdroplet name)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected? v] contains (waterdroplet name)?> then\n        start sound [Open Water Blocker!!! v]\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        hide\n        go to x: (x) y: (y)\n        wait (2) seconds\n        start sound [Open Water Blocker!!! v]\n        go to x: (x) y: (y)\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        show\n        start sound [Water Blocker Close v]\n    else\n        start sound [No WaterDroplet!!! v]\n    end\n    wait until <not <touching (player v)?>>\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [exit scene v]\ndelete this clone\n\ndefine Spawn (type) at (x) (y) Dir. (dir.) Turn (degree)\nset [turn v] to (degree)\ngo to x: (x) y: (y)\npoint in direction (dir.)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nif < (costume [name v]) contains [WaterDroplet]?> then\n    WaterDroplet Blocker (x position) (y position) WaterDroplet (costume [name v])\nend\nif <(Turn) > []> then\n    set rotation style [all around v]\n    forever\n        turn right (Turn) degrees\n    end\nend\nif <(Scene Num.) = [4]> then\n    Move Platform2\nend\nif <(Scene Num.) = [102]> then\n    Move Platform3\nend\nif <(Scene Num.) = [103]> then\n    Move Platform\nend\nif <(Scene Num.) = [104]> then\n    Move Platform4\nend\nif <(Scene Num.) = [105]> then\n    Move Platform5\nend\n\ndefine Rotation Math (ccw)\nset [dx v] to (([x position v] of [player v]) - (x position))\nset [dy v] to (([y position v] of [player v]) - (y position))\nset [sin v] to ([sin v] of (ccw) )\nset [cos v] to ([cos v] of (ccw) )\nset [dx v] to ((((DX) * (COS)) - ((DY) * (SIN))) - (DX))\nset [dy v] to ((((DX) * (SIN)) + ((DY) * (COS))) - (DY))\n\n@Collect Sprite\n\nwhen I receive [change scene v]\nif <(Scene Num.) = (My Scene)> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nrepeat until <touching (player v)?>\n    change y by ((0.3) * ([sin v] of (Frame) ))\n    change [frame v] by (5)\nend\nset [my scene v] to []\nif <(costume [number v]) = [1]> then\n    start sound [Magic Spell v]\n    change [sun particles v] by (1)\nelse\n    if <(costume [number v]) = [3]> then\n        start sound [Glug v]\n        set [spawn scene v] to (Scene Num.)\n        set [spawn x? v] to ([x position v] of [player v])\n        set [spawn y? v] to ([y position v] of [player v])\n    else\n        start sound [Drip Drop v]\n        add (costume [name v]) to [collected? v]\n    end\nend\nrepeat (20)\n    change [ghost v] effect by (5)\n    change [color v] effect by (5)\nend\nhide\n\nwhen I receive [setup v]\ndelete all of [collected? v]\nhide\nPosition [Sun Partical] Scene [1] x, y [9] [-80]\nPosition [Sun Partical] Scene [1] x, y [190] [-58]\nPosition [Sun Partical] Scene [2] x, y [-3] [-1]\nPosition [Sun Partical] Scene [3] x, y [74] [-69]\nPosition [Sun Partical] Scene [4] x, y [58] [-80]\nPosition [Check Points] Scene [4] x, y [183] [3]\nPosition [Sun Partical] Scene [5] x, y [45] [-11]\nPosition [Sun Partical] Scene [6] x, y [-102] [-13]\nPosition [Sun Partical] Scene [7] x, y [120] [-80]\nPosition [Sun Partical] Scene [7] x, y [154] [-81]\nPosition [Check Points] Scene [8] x, y [-128] [-64]\nPosition [Sun Partical] Scene [101] x, y [177] [-5]\nPosition [Sun Partical] Scene [101] x, y [-131] [15]\nPosition [Sun Partical] Scene [102] x, y [86] [32]\nPosition [Sun Partical] Scene [103] x, y [-61] [29]\nPosition [Check Points] Scene [104] x, y [176] [-34]\nPosition [Sun Partical] Scene [104] x, y [79] [-39]\nPosition [Sun Partical] Scene [105] x, y [46] [75]\nPosition [Sun Partical] Scene [105] x, y [207] [-45]\nPosition [WaterDroplet 1] Scene [106] x, y [189] [-45]\nPosition [Sun Partical] Scene [108] x, y [-26] [-129]\nPosition [WaterDroplet 2] Scene [108] x, y [-87] [-129]\nPosition [Sun Partical] Scene [108] x, y [-141] [-129]\nPosition [Sun Partical] Scene [108] x, y [152] [-102]\nPosition [Sun Partical] Scene [108] x, y [152] [-26]\nPosition [Sun Partical] Scene [108] x, y [152] [95]\nPosition [Sun Partical] Scene [307] x, y [-83] [55]\nPosition [Sun Partical] Scene [307] x, y [36] [55]\nPosition [Check Points] Scene [307] x, y [-225] [22]\nPosition [Sun Partical] Scene [308] x, y [-117] [118]\nPosition [Sun Partical] Scene [308] x, y [-226] [109]\nPosition [Sun Partical] Scene [308] x, y [1] [75]\nPosition [Heal Before Boss] Scene [306] x, y [-8] [106]\n\ndefine Position (costume name) Scene (scene) x, y (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\nwhen flag clicked\nset [sun particles v] to [0]\nset [skin v] to [0]\n\nwhen I start as a clone\nforever\n    if <(costume [name v]) = [Heal Before Boss]> then\n        if <(Lives) < [3]> then\n            if <touching (player v)?> then\n                wait until <not <touching (player v)?>>\n                change [lives v] by (1)\n            end\n        end\n    end\nend\n\n@Messages\n\nwhen flag clicked\nshow variable [sun particles v]\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 x: (0) y: (0)\nswitch costume to (game over v)\ngo to [front v] layer\nshow\nbroadcast (Main Menu v)\n\nwhen I receive [play again??? v]\nshow variable [sun particles v]\nhide\n\nwhen I receive [switch to home screen v]\nshow variable [sun particles v]\ngo to x: (0) y: (0)\nswitch costume to (main menu v)\ngo to [front v] layer\nshow\n\nwhen I receive [reset game v]\nshow variable [sun particles v]\n\nwhen flag clicked\nforever\n    glide (1) secs to x: (0) y: (0)\n    wait (0.3) seconds\n    glide (1) secs to x: (0) y: (2)\n    wait (0.3) seconds\nend\n\n@Play Button\n\nwhen I receive [main menu v]\ngo to [front v] layer\nshow\ngo to x: (0) y: (-65)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((140) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen this sprite clicked\nhide\nbroadcast (Play Again??? v)\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [shop open v]\nhide\n\nwhen I receive [shop close; ready v]\nshow\n\nwhen backdrop switches to [2 v]\nshow\n\n@Play Again Button\n\nwhen flag clicked\nhide\n\nwhen this sprite clicked\nhide\nbroadcast (Play Again??? v)\n\nwhen I receive [game over! v]\nwait (0.1) seconds\ngo to [front v] layer\ngo to x: (-3) y: (-105)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((140) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen I receive [play again??? v]\nhide\n\nwhen backdrop switches to [2 v]\nwait (0.1) seconds\ngo to [front v] layer\ngo to x: (-3) y: (-105)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((140) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\n@Water Droplets\n\nwhen I receive [switch to home screen v]\nrepeat (10)\n    go to [front v] layer\nend\nforever\n    switch costume to (pick random (1) to (5))\n    go to x: (36) y: (28)\n    show\n    repeat (50)\n        change y by (-2)\n    end\n    hide\n    wait (pick random (1) to (5)) seconds\nend\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [reset game v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\nrepeat (10)\n    go to [front v] layer\nend\nforever\n    switch costume to (pick random (1) to (5))\n    go to x: (36) y: (28)\n    show\n    repeat (50)\n        change y by (-2)\n    end\n    hide\n    wait (pick random (1) to (5)) seconds\nend\n\n@Home Button\n\nwhen I receive [game over! v]\nrepeat (10)\n    go to [front v] layer\n    show\nend\n\nwhen I receive [main menu v]\nwait (0.1) seconds\nhide\ngo to x: (-164) y: (-78)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((140) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen I receive [reset game v]\nhide\n\nwhen this sprite clicked\nbroadcast (Main Menu v)\nbroadcast (Switch to Home Screen v)\nhide\n\nwhen backdrop switches to [2 v]\ngo to x: (-200) y: (30)\nshow\n\n@Mute Button\n\nwhen this sprite clicked\nnext costume\nforever\n    if <(costume [name v]) = [Off]> then\n        forever\n            stop all sounds\n            wait until <(costume [name v]) = [On]>\n        end\n    end\nend\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [reset game v]\nhide\n\nwhen I receive [main menu v]\nset [ghost v] effect to (25)\ngo to x: (-125) y: (-64)\nrepeat (3)\n    go to [front v] layer\nend\n\nwhen flag clicked\nswitch costume to (on v)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((120) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen I receive [switch to home screen v]\nshow\n\nwhen I receive [shop open v]\nhide\n\nwhen I receive [shop close; ready v]\nshow\n\n@Enemies\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [change scene v]\nset size to (80) %\nif <(Scene Num.) = [106]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Enemie] at [186] [-43] Dir. [-90]\n    else\n        Spawn [Enemie] at [111] [-44] Dir. [90]\n    end\nend\nif <(Scene Num.) = [6]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Enemie] at [186] [-43] Dir. [-90]\n    else\n        Spawn [Enemie] at [111] [-44] Dir. [90]\n    end\nend\nif <(Scene Num.) = [208]> then\n    Spawn [Enemie] at [15] [-116] Dir. [-90]\nend\nif <(Scene Num.) = [306]> then\n    set size to (100) %\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Enemie] at [200] [26] Dir. [-90]\n        Spawn [Enemie] at [107] [26] Dir. [-90]\n        Spawn [Enemie] at [57] [26] Dir. [-90]\n    else\n        Spawn [Enemie] at [-200] [26] Dir. [90]\n        Spawn [Enemie] at [-107] [26] Dir. [90]\n        Spawn [Enemie] at [-57] [26] Dir. [90]\n    end\nend\nif <(Scene Num.) = [305]> then\n    set size to (200) %\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Enemie] at [100] [26] Dir. [-90]\n    else\n        Spawn [Enemie] at [-100] [26] 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 (enemie1 v)\n    set rotation style [don't rotate v]\n    X - Movement\n    Down Movement\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 <<(INV.) = [0]> and <touching (player v)?>> then\n        Touching Player\n    end\nend\n\nwhen I receive [exit scene v]\ndelete this clone\n\ndefine Down Movement\nchange [speed - y v] by (-1)\nchange y by (Speed - Y)\nrepeat until <not <<touching (level v)?> or <touching (water puddles v)?>>>\n    change y by (1)\n    set [speed - y v] to [0]\nend\n\ndefine X - Movement\nmove (2) steps\nrepeat (4)\n    if <not <<touching (level v)?> or <touching (_edge_ v)?>>> then\n        if <not <<touching (blockers v)?> or <touching (platforms v)?>>> then\n            if <not <touching (water puddles v)?>> then\n                stop [this script v]\n            end\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 [player v]) < [-3]> then\n    broadcast (Bounce v)\n    start sound [Water Stomp v]\n    start sound [pop v]\n    switch costume to (stepped on v)\n    wait (0.3) seconds\n    repeat (10)\n        change [pixelate v] effect by (10)\n        change [brightness v] effect by (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nbroadcast (Life Lost! 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@Blockers\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nrepeat (3)\n    go to [back v] layer\nend\n\nwhen I receive [change scene v]\ngo to x: (0) y: (0)\nswitch costume to (nothing v)\nswitch costume to (join [Scene] (Scene Num.))\n\n@Water Puddles\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (nothing v)\nswitch costume to (join [Scene] (Scene Num.))\n\n@Joystick\n\ndefine Key Controls\nset [stick x v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nchange [stick x v] by ((0) - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\nset [stick y v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\nchange [stick y v] by ((0) - <<key (down arrow v) pressed?> or <key (s v) pressed?>>)\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    change [joystick button v] by (1)\nelse\n    set [joystick button v] to [0]\nend\n\ndefine ACTIVATED\ngo to (mouse-pointer v)\nswitch costume to (ready! v)\ncreate clone of (_myself_ v)\nswitch costume to (stick v)\ncreate clone of (_myself_ v)\nswitch costume to (active v)\nset [joystick button v] to []\nrepeat until <(distance to [mouse-pointer v]) > ((size) * (1.5))>\n    Joystick Movement?\n    Joystick Button?\nend\nbroadcast (BYE Stick v)\n\ndefine Joystick Movement?\nset [stick x v] to (((mouse x) - (x position)) / (RANGE))\nset [stick y v] to (((mouse y) - (y position)) / (RANGE))\nif <([abs v] of (Stick X) ) > [1]> then\n    set [stick x v] to ((Stick X) / ([abs v] of (Stick X) ))\nend\nif <([abs v] of (Stick Y) ) > [1]> then\n    set [stick y v] to ((Stick Y) / ([abs v] of (Stick Y) ))\nend\n\ndefine Joystick Button?\nif <mouse down?> then\n    if <(Joystick Button) > []> then\n        change [joystick button v] by (1)\n    end\nelse\n    set [joystick button v] to [0]\nend\n\nwhen I receive [bye stick v]\ndelete this clone\n\nwhen I start as a clone\nif <(costume [name v]) = [Stick]> then\n    go [forward v] (1) layers\n    set [ghost v] effect to (0)\n    forever\n        go to (joystick v)\n        change x by ((Stick X) * (RANGE))\n        change y by ((Stick Y) * (RANGE))\n    end\nend\ngo to x: (185) y: (-129)\nwait until <not <mouse down?>>\nswitch costume to (active v)\nforever\n    if <mouse down?> then\n        set [ghost v] effect to (25)\n    else\n        set [ghost v] effect to (75)\n    end\nend\n\nwhen flag clicked\nset size to (80) %\nset [ghost v] effect to (70)\nset [range v] to ((size) / (2.5))\nforever\n    go [forward v] (50) layers\n    switch costume to (joy v)\n    go to x: (-184) y: (-130)\n    repeat until <not <mouse down?>>\n        Key Controls\n    end\n    repeat until <mouse down?>\n        Key Controls\n    end\n    if <(distance to [mouse-pointer v]) < (size)> then\n        ACTIVATED\n    end\nend\n\nwhen I receive [mobile controls v]\nshow\n\nwhen I receive [com. controls v]\nhide\n\n@Switch Controls\n\nwhen this sprite clicked\nnext costume\nforever\n    if <(costume [name v]) = [Mobile]> then\n        switch costume to (mobile v)\n        broadcast (COM. CONTROLS v) and wait\n    end\n    if <(costume [name v]) = [Computer]> then\n        switch costume to (computer v)\n        broadcast (MOBILE CONTROLS v) and wait\n    end\nend\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [reset game v]\nhide\n\nwhen I receive [main menu v]\ngo to x: (102) y: (-62)\nrepeat (3)\n    go to [front v] layer\nend\n\nwhen flag clicked\nbroadcast (COM. CONTROLS v) and wait\nswitch costume to (mobile v)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((120) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen I receive [switch to home screen v]\nshow\n\nwhen I receive [shop open v]\nhide\n\nwhen I receive [shop close; ready v]\nshow\n\n@Shop Open Button\n\nwhen I receive [switch to home screen v]\ngo to [front v] layer\ngo to x: (-23) y: (-172)\nshow\n\nwhen flag clicked\nshow\nwait (0.01) seconds\ngo to [front v] layer\ngo to x: (-23) y: (-172)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((105) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Shop Open v)\nhide\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [shop close; ready v]\nhide\n\nwhen I receive [shop close; ready v]\ngo to x: (-23) y: (-172)\ngo to [front v] layer\nshow\n\n@Shop Background\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [shop open v]\nshow\ngo [forward v] (60) layers\ngo to x: (0) y: (-172)\nrepeat (86)\n    change y by (2)\nend\nbroadcast (Shop Ready v)\n\nwhen flag clicked\nhide\n\nwhen I receive [shop close v]\nshow\ngo [forward v] (60) layers\nrepeat (86)\n    change y by (-2)\nend\nhide\nbroadcast (Shop Close; READY v)\n\n@Shop Close Button\n\nwhen flag clicked\nhide\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((105) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Shop Close v)\nhide\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [shop ready v]\nwait (0.01) seconds\ngo [forward v] (59) layers\ngo to x: (-257) y: (-29)\nshow\nrepeat (30)\n    change x by (2)\nend\n\n@Skins\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [shop close v]\nhide\n\nwhen this sprite clicked\nbroadcast (Change Skin!!! v)\n\nwhen I start as a clone\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <not <(Sun Particles) < (Cost For Skin)>> then\n            Buy Skin\n            wait until <not <mouse down?>>\n        else\n            broadcast (NOT ENOUGH v)\n            stop [this script v]\n        end\n    end\nend\n\ndefine Make Skin (name) (cost)\nset [skin name v] to (name)\nset [cost for skin v] to (cost)\nswitch costume to (name)\ncreate clone of (_myself_ v)\nchange x by (100)\nstop [this script v]\n\ndefine Buy Skin\nbroadcast (Purchased item! v)\nchange [sun particles v] by ((Cost For Skin) * (-1))\nif <(Skin Name) = [1]> then\n    set [skin v] to [75]\nelse\n    if <(Skin Name) = [2]> then\n        set [skin v] to [100]\n    else\n        if <(Skin Name) = [3]> then\n            set [skin v] to [150]\n        else\n            if <(Skin Name) = [4]> then\n                set [skin v] to [687]\n            end\n        end\n    end\nend\n\nwhen I start as a clone\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 I receive [shop ready v]\ngo [forward v] (60) layers\ngo to x: (-120) y: (-90)\nshow\nMake Skin [1] [20]\nMake Skin [2] [50]\nMake Skin [3] [90]\nMake Skin [4] [140]\n\n@Not Enough Sign\n\nwhen flag clicked\nhide\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((105) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [not enough v]\nswitch costume to (not enough v)\ngo [forward v] (70) layers\ngo to x: (-257) y: (-70)\nshow\nrepeat (22)\n    change x by (2)\nend\nwait (2.5) seconds\nrepeat (30)\n    change x by (-2)\nend\nhide\nstop [this script v]\n\nwhen I receive [shop close v]\nhide\n\nwhen I receive [purchased item! v]\nswitch costume to (purchased! v)\ngo [forward v] (70) layers\ngo to x: (-257) y: (-70)\nshow\nrepeat (22)\n    change x by (2)\nend\nwait (2.5) seconds\nrepeat (30)\n    change x by (-2)\nend\nhide\nstop [this script v]\n\n@Lives\n\nwhen I receive [switch to home screen v]\nhide\n\nwhen I receive [reset game v]\nset [lives v] to [3]\ngo to [front v] layer\nswitch costume to (3 v)\nshow\n\nwhen I receive [play again??? v]\ngo to [front v] layer\nshow\n\nwhen flag clicked\ngo to x: (-117) y: (161)\nswitch costume to (3 v)\nhide\nforever\n    go to [front v] layer\n    switch costume to (Lives)\n    if <(Lives) = [0]> then\n        hide\n    end\nend\n\n@Headlines\n\nwhen flag clicked\ngo to [front v] layer\nrepeat until <touching (messages v)?>\n    wait (3.5) seconds\n    go to x: (98) y: (155)\n    hide\n    wait (6) seconds\n    next costume\n    show\nend\nforever\n    if <touching (messages v)?> then\n        hide\n    end\nend\n\n@Hide Skins\n\nwhen I receive [play again??? v]\nhide\n\nwhen I receive [shop close v]\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I start as a clone\ngo [forward v] (65) layers\nif <(Skin) = [75]> then\n    switch costume to (1 v)\n    show\nend\nif <(Skin) = [100]> then\n    switch costume to (2 v)\n    show\nend\nif <(Skin) = [150]> then\n    switch costume to (3 v)\n    show\nend\nif <(Skin) = [687]> then\n    switch costume to (4 v)\n    show\nend\n\nwhen I receive [shop ready v]\ncreate clone of (_myself_ v)\n\nwhen I receive [purchased item! v]\ncreate clone of (_myself_ v)\n\n@Warning\n\nwhen I receive [warning! v]\ngo to (obstacles v)\nrepeat (4)\n    show\n    wait (0.1) seconds\n    hide\nend\nhide\nbroadcast (SHOW v) and wait\n\nwhen flag clicked\nhide\n\n@Outdoors!!!\n\nwhen flag clicked\ngo to [back v] layer\nhide\nforever\n    if <(Scene Num.) = [305]> then\n        if <(Lives) > [0]> then\n            switch costume to (light v)\n            set [ghost v] effect to (30)\n            set [brightness v] effect to (15)\n            show\n        end\n    else\n        if <(Scene Num.) = [303]> then\n            switch costume to (talk v)\n            show\n        else\n            hide\n        end\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    show\nend\n\n