☁︎Scratch cat platformer part 3☁︎

Instructions: Read the instructions before playing! ⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️⬇️\nPart 3 is out!\nPart 2:\nhttps://scratch.mit.edu/projects/648028673\nPart 1:\nhttps://scratch.mit.edu/projects/628988104\nMobile friendly!\nControls:\nW,A,S,D or arrow keys to move.\nSpace to throw sword and to throw ninja stars\n"S" to change weapon\nyour swords size depends on how many coins you have collected. This is platform game, with vertical levels, springs, wall jump and moving spikes, ninja stars, lava and platforms, collect coins, collect lives, enemies, animated platform, checkpoints and a very special key to unlock the door. \nCan you beat the highscore???\nWrite in the comments if you have any suggestions.\n\nChangelog:\nJan 22 2022,Added springs\nJan 23 2022, Fixed bug with the collectables\nJan 29 2022, Made the platforms slower\nFeb 1 2022, Added a sword\nFeb 1 2022, Added ninja stars\nFeb 4 2022, Changed the levels\nFeb 13 2022, made it mobile friendly\nFeb 17 2022, I change the play button\nMar 4 2022, I made a joystick

@Stage\n\nwhen flag clicked\nforever\n    play sound [Nebula v] until done\nend\n\n@Blank\n\n@Player\n\nif  then\n    change x by (-6)\nend\nif  then\n    change x by (6)\nend\n\nwhen flag clicked\nbroadcast (Main Menu v)\nhide\n\ndefine move - in steps (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((speed x) / (steps))\n    Check Touching Solid\n    if <(Touching) > [0]> then\n        Collide X-Slope or Wall?\n    end\n    set [last value v] to (y position)\n    change y by ((speed y) / (steps))\n    Check Touching Solid\n    if <(Touching) > [0]> then\n        Collide Y- Celling or Floor\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-150) y: (50)\n\ndefine Check Touching Solid\nif <<<touching (level v)?> or <touching (doors v)?>> or <touching (platform v)?>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick-player v]\nMoved by moving platform\nswitch backdrop to <touching (level v)?>\nControls-Up and Down\nControls-Left and Right\nmove - in steps (([abs v] of (speed y) ) + ([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 <key (d v) pressed?>> or <(STICK X) > [0.5]>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <(STICK X) < [-0.5]>>)\nif <(KEY X) = [0]> then\n    if <<(Falling) > [2]> and <(Wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.9))\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) * (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 (1)\nend\nset [speed x v] to ((speed x) * (RESISTANCE))\n\nchange [speed x v] by ((KEY X) * (ACCELERATION))\npoint in direction ((KEY X) * (90))\nchange [frame v] by (1)\n\nwhen I receive [game loop v]\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    Show Health (LIVES) of (max health) offset y [40]\nend\n\ndefine Reset and Begin Level\nset [invulnerable 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]\nset [scene # v] to [1]\npoint in direction (90)\nBegin Scene # (SPAWN SCENE) Go to x, y: (SPAWN X) (SPAWN Y)\n\nwhen I receive [tick - last v]\nif <(x position) > [235]> then\n    Begin Scene # ((SCENE #) + (1)) Go to x, y: [-235] []\nend\nif <(x position) < [-235]> then\n    Begin Scene # ((SCENE #) + (-1)) Go to x, y: [235] []\nend\nif <(y position) > [180]> then\n    Begin Scene # ((SCENE #) + (100)) Go to x, y: [] [-160]\nend\nif <(y position) < [-180]> then\n    Begin Scene # ((SCENE #) + (-100)) Go to x, y: [] [180]\nend\nif <touching (danger v)?> then\n    broadcast (Lose Life v)\nend\n\ndefine Begin 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 (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    Fix Collisions in Direction [0]\nelse\n    Fix Collisions in Direction [90]\nend\nSet Costume\nbroadcast (Game Loop v)\n\ndefine Fix Collisions in Direction (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 (hitbox v2 v)\nset rotation style [don't rotate v]\nset [platform dx v] to []\nset [platform dy v] to []\n\ndefine Set Costume\nset rotation style [left-right v]\nif <(Wall slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(Falling) > [1]> then\n    if <(speed y) > [0]> then\n        switch costume to (jump01 v)\n    else\n        switch costume to (run_j2 v)\n    end\n    stop [this script v]\nend\nif <(frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((frame) mod (16)) ))\nelse\n    switch costume to (hit angle 0 v)\n    repeat (5)\n        Check Touching Solid\n        if <(Touching) < [1]> then\n            switch costume to ((costume [number v]) + (5))\n            stop [this script v]\n        end\n        next costume\n    end\n    switch costume to (stand v)\nend\n\ndefine Collide 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 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))\nSlip\n\ndefine Collide Y- Celling or Floor\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    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 (hitbox wallslide v)\nset rotation style [left-right v]\nCheck Touching Solid\nset [wall slide v] to (Touching)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\nwhen flag clicked\nset size to (40) %\n\nwhen I receive [lose life v]\nif <(SCENE #) = [408]> then\n    start sound [Oops v]\n    if <(LIVES) = [0]> then\n        broadcast (Game Over v)\n    end\nelse\n    switch costume to (die v)\n    set [invulnerable v] to [1]\n    stop [other scripts in sprite v]\n    start sound [Oops v]\n    wait (1) seconds\n    repeat (40)\n        change [ghost v] effect by (2.5)\n    end\n    wait (0.5) seconds\n    change [lives v] by (-1)\n    if <(LIVES) > [0]> then\n        Reset and Begin Level\n    else\n        broadcast (Game Over v)\n    end\nend\n\ndefine Moved by moving platform\nchange x by (PLATFORM DX)\nchange y by (PLATFORM DY)\nCheck Touching Solid\nif <(Touching) > [0]> then\n    Find Closest Space to (x position) (y position) max [16]\n    if <(Touching) > [0]> then\n        broadcast (Lose Life v)\n    end\nend\n\ndefine Find Closest Space to (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        Check Touching Solid\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 flag clicked\nshow list [collected v]\n\nwhen I receive [start now! v]\nshow\nset [gravity v] to [-1.5]\nset [acceleration v] to [1.5]\nset [jump duration v] to [6]\nset [resistance v] to [0.8]\nset [jump force v] to [12]\nbroadcast (Setup v)\nbroadcast (Reset Game v) and wait\nset [lives v] to [6]\nset [spawn scene v] to [1]\nset [spawn x v] to [-150]\nset [spawn y v] to [55]\nset [max health v] to [7]\nset [health v] to [6]\nReset and Begin Level\n\nset [lives v] to [100]\n\nwhen I receive [player - bounce v]\nset [speed y v] to [15]\n\nset [lives v] to [5]\n\nadd [Key 1] to [collected v]\n\nset [lives v] to [4]\n\nbroadcast (Start NOW! v)\n\nwhen I receive [trampoline v]\nset [speed y v] to [20]\n\nwhen flag clicked\nforever\n\nset [☁ player x v] to (x position)\nset [☁ player y v] to (y position)\ngo to x: (0) y: (0)\n\nwhen I receive [start v]\nset [scene # v] to [409]\n\nwhen I receive [start now! v]\nset [scene # v] to [1]\n\nwait (1) seconds\nset [scene # v] to [1]\n\nwhen flag clicked\nset [scene # v] to [409]\n\nwhen I receive [start now! v]\n\nwhen I receive [end boss v]\nrepeat (100)\n    change [brightness v] effect by (1)\nend\nstop [other scripts in sprite v]\n\ndefine Show Health (health) of (max) offset y (y)\nadd (x position) to [heaths v]\nadd ((y position) + (y)) to [heaths v]\nadd ((health) / (max)) to [heaths v]\ncreate clone of (health bar v)\n\nwhen I receive [game loop v]\nforever\n    if <(LIVES) < [1]> then\n        broadcast (Game Over v)\n        broadcast (Main Menu v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\ndelete all of [scores v]\n\nset [lives v] to [6]\n\n@Collectable\n\nwhen I receive [change scene v]\nif <(SCENE #) = (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.5) * ([sin v] of (frame) ))\n    change [frame v] by (5)\nend\nset [my scene v] to []\nif <(costume [name v]) = [apple]> then\n    change [apples v] by (1)\n    start sound [Collect v]\nelse\n    if <(costume [name v]) = [Green Flag]> then\n        start sound [Wand v]\n        set [spawn scene v] to (SCENE #)\n        set [spawn x v] to (x position)\n        set [spawn y v] to (y position)\n    else\n        if <(costume [name v]) = [heart]> then\n            change [lives v] by (1)\n            start sound [Wand v]\n        else\n            if <(costume [name v]) = [sword]> then\n                set [sword? v] to [1]\n                set [weapon v] to [sword]\n                start sound [Wand v]\n            else\n                if <(costume [name v]) = [BIG apple]> then\n                    start sound [Collect v]\n                    change [apples v] by (10)\n                else\n                    if <(costume [name v]) = [ninja star]> then\n                        set [ninja star? v] to [1]\n                        set [weapon v] to [ninja star]\n                        start sound [Wand v]\n                    else\n                        if <(costume [name v]) = [Key 1]> then\n                            start sound [Wand v]\n                            add (costume [name v]) to [collected v]\n                        else\n                            if <(costume [name v]) = [Key 2]> then\n                                start sound [Wand v]\n                                add (costume [name v]) to [collected v]\n                            else\n                                start sound [Collect v]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nrepeat (20)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nhide\n\nstart sound [Collect v]\n\nwhen I receive [reset game v]\ndelete this clone\n\nshow\n\nwhen I receive [reset game v]\ndelete this clone\n\nwhen I start as a clone\nif <touching (player v)?> then\n\nwhen I receive [start v]\ngo [backward v] (1) layers\n\nwhen flag clicked\n\nwait (5) seconds\n\nbroadcast (Start NOW! v)\n\nwhen I receive [start v]\n\nchange [lives v] by (1)\n\ngo to [front v] layer\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\nchange [apples v] by (10)\n\nset [ninja star? v] to [1]\nset [weapon v] to [ninja star]\nstart sound [Wand v]\n\nstart sound [Collect v]\n\nPlace [heart] scene [409] xy [-9] [-53]\nPlace [heart] scene [409] xy [-20] [-53]\nPlace [Green Flag] scene [3] xy [0] [145]\nPlace [heart] scene [409] xy [-35] [-53]\nPlace [heart] scene [409] xy [-35] [-30]\nPlace [heart] scene [409] xy [-20] [-30]\n\nbroadcast (Change Scene v)\n\nwhen I receive [setup v]\ndelete all of [collected v]\nset [apples v] to [0]\nset [frame v] to [0]\nhide\nPlace [Key 1] scene [101] xy [-47] [28]\nPlace [Key 2] scene [106] xy [143] [108]\nPlace [BIG apple] scene [9] xy [-37] [-37]\nPlace [Green Flag] scene [2] xy [-17] [121]\nPlace [Green Flag] scene [3] xy [-79] [129]\nPlace [Green Flag] scene [4] xy [-155] [-82]\nPlace [Green Flag] scene [107] xy [154] [84]\nPlace [Green Flag] scene [8] xy [-155] [100]\nPlace [Green Flag] scene [109] xy [21] [118]\nPlace [Green Flag] scene [11] xy [54] [-18]\nPlace [apple] scene [105] xy [43] [-21]\nPlace [apple] scene [105] xy [-220] [0]\nPlace [apple] scene [104] xy [-200] [-57]\nPlace [apple] scene [204] xy [152] [-165]\nPlace [apple] scene [204] xy [58] [-122]\nPlace [apple] scene [206] xy [191] [118]\nPlace [apple] scene [205] xy [184] [-4]\nPlace [apple] scene [205] xy [184] [20]\nPlace [apple] scene [205] xy [184] [40]\nPlace [apple] scene [205] xy [184] [60]\nPlace [apple] scene [206] xy [191] [145]\nPlace [apple] scene [1] xy [0] [-51]\nPlace [apple] scene [1] xy [173] [119]\nPlace [apple] scene [2] xy [9] [-12]\nPlace [apple] scene [2] xy [152] [-18]\nPlace [apple] scene [2] xy [82] [82]\nPlace [apple] scene [3] xy [4] [79]\nPlace [apple] scene [3] xy [4] [50]\nPlace [apple] scene [3] xy [4] [20]\nPlace [apple] scene [3] xy [4] [-10]\nPlace [heart] scene [-90] xy [0] [40]\nPlace [apple] scene [-89] xy [-69] [128]\nPlace [apple] scene [-89] xy [157] [128]\nPlace [apple] scene [-89] xy [157] [40]\nPlace [heart] scene [111] xy [-182] [-141]\nPlace [heart] scene [111] xy [-180] [-94]\nPlace [heart] scene [111] xy [-58] [-25]\nPlace [heart] scene [111] xy [58] [31]\nPlace [heart] scene [111] xy [179] [-17]\nPlace [heart] scene [112] xy [-47] [38]\nPlace [heart] scene [112] xy [188] [-58]\nPlace [heart] scene [12] xy [188] [-58]\nPlace [heart] scene [-88] xy [188] [-58]\nPlace [heart] scene [-188] xy [188] [-58]\nPlace [sword] scene [1] xy [10] [77]\nPlace [ninja star] scene [102] xy [72] [45]\n\nPlace [apple] scene [4] xy [4] [-40]\n\nwhen I receive [start now! v]\n\nbroadcast (Setup v)\n\n@Enemy\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\ngo to [back v] layer\nset size to (100) %\n\nwhen I receive [change scene v]\nif <(SCENE #) = [1]> then\n    Spawn [Red] at [163] [13] dir [90]\n    Spawn [Red] at [11] [66] dir [-90]\nend\nif <(SCENE #) = [102]> then\n    Spawn [Red] at [47] [-34] dir [90]\nend\nif <(SCENE #) = [5]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [200] [-126] dir [-90]\n        Spawn [Red] at [170] [-126] dir [-90]\n        Spawn [Red] at [140] [-126] dir [-90]\n    else\n        Spawn [Red] at [0] [-126] dir [90]\n        Spawn [Red] at [30] [-126] dir [90]\n        Spawn [Red] at [60] [-126] dir [90]\n    end\nend\nif <(SCENE #) = [-91]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [200] [-126] dir [-90]\n        Spawn [Red] at [170] [-126] dir [-90]\n        Spawn [Red] at [140] [-126] dir [-90]\n    else\n        Spawn [Red] at [0] [-126] dir [90]\n        Spawn [Red] at [30] [-126] dir [90]\n        Spawn [Red] at [60] [-126] dir [90]\n    end\nend\nif <(SCENE #) = [7]> then\n    Spawn [Red] at [150] [68] dir [-90]\nend\n\nif <(SCENE #) = [307]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [211] [54] dir [-90]\n    else\n        Spawn [Red] at [177] [54] dir [-90]\n    end\nend\nif <(SCENE #) = [308]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [205] [37] dir [-90]\n    else\n        Spawn [Red] at [-205] [37] dir [90]\n    end\nend\nif <(SCENE #) = [5]> then\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [192] [-63] dir [-90]\n    else\n        Spawn [Red] at [-20] [-63] dir [90]\n    end\nend\n\nif <(SCENE #) = [4]> then\n    Spawn [Red] at [220] [35] dir [90]\nend\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nshow\nset [speed y v] to [0]\nset [frame v] to [0]\nforever\n    switch costume to (red1 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 <<(INVULNERABLE) = [0]> and <touching (player v)?>> then\n        Touching Player\n    end\n    if <<touching (sword v)?> or <touching (sprite7 v)?>> then\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        hide\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 (level v)?>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\nwhen flag clicked\ncreate clone of (_myself_ v)\n\ndefine Move - Left or Right\nmove (2) steps\nrepeat (4)\n    if <not <<touching (level v)?> or <touching (_edge_ v)?>>> then\n        if <not <<touching (safe zones v)?> or <touching (doors 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 [player v]) < [-3]> then\n    broadcast (Player - Bounce v)\n    start sound [Squish Pop v]\n    switch costume to (red squish v)\n    wait (0.3) seconds\n    repeat (10)\n        change [ghost v] effect by (25)\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\nwhen I receive [start now! v]\nforever\n\nSpawn [Red] at [45] [-70] dir [-90]\nSpawn [Red] at [-60] [-70] dir [90]\n\n@Level\n\nwhen flag clicked\ndelete all of [collected v]\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\nerase all\nStamp Outline\nStamp Shadow\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (80)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\nset [lives v] to [1000]\n\nwhen flag clicked\nswitch costume to (scene1 v)\nshow list [scores v]\n\nwhen flag clicked\nset [☁ timer v] to [0]\n\nforever\n\nset [lives v] to [9999999]\n\nwhen I receive [start now! v]\nforever\n    if <not <(costume [number v]) = [27]>> then\n        wait (1) seconds\n        change [☁ timer v] by (1)\n    end\nend\n\nif <(costume [number v]) = [27]> then\n\nstop [other scripts in sprite v]\nwait (1.5) seconds\nhide list [scores v]\nstop [all v]\n\nwhen I receive [reset game v]\nset [☁ timer v] to [0]\n\nset [scene # v] to [308]\n\nhide\n\nwhen flag clicked\nshow\n\nwhen flag clicked\n\ninsert (username) at (1) of [scores v] \n\n@Safe Zones\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nset [ghost v] effect to (100)\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\n\nset y to (0)\n\n@Platform\n\nwhen I receive [change scene v]\nhide\nif <(SCENE #) = [0]> then\n    set size to (100) %\n    Spawn [plank] at [104] [-9] dir [90] turn [5]\n    Spawn [plank] at [-52] [-9] dir [90] turn [-5]\nend\nif <(SCENE #) = [-1]> then\n    set size to (100) %\n    Spawn [Wheel] at [-77] [-30] dir [90] turn [3]\nend\nif <(SCENE #) = [-2]> then\n    set size to (100) %\n    Spawn [maze] at [0] [0] dir [90] turn [4]\nend\nif <(SCENE #) = [4]> then\n    set size to (100) %\n    Spawn [cup] at [-57] [-35] dir [90] turn [-2]\n    Spawn [plank] at [-29] [-80] dir [90] turn [2]\n    Spawn [wheel2] at [-49] [11] dir [90] turn [1]\nend\nif <(SCENE #) = [3]> then\n    set size to (100) %\n    Spawn [platform2] at [20] [73] dir [90] turn []\nend\nif <(SCENE #) = [2]> then\n    set size to (100) %\n    Spawn [platform] at [2] [-49] dir [90] turn []\n    Spawn [Key 1] at [197] [-4] dir [90] turn []\nend\nif <(SCENE #) = [108]> then\n    set size to (100) %\n    Spawn [platform] at [-80] [-12] dir [90] turn []\nend\nif <(SCENE #) = [6]> then\n    set size to (100) %\n    Spawn [Key 2] at [197] [-38] dir [90] turn []\nend\n\nanimate platform 5\n\nSpawn [platform1] at [-70] [100] dir [90] turn []\n\nSpawn [platform2] at [-105] [-50] dir [90] turn []\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 (new x) (new y)\nif <(turn) > []> then\n    change y by (4)\n    if <touching (player v)?> then\n        rotaion maths ccw ((0) - (turn))\n    end\nelse\n    if <(new 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 ((new x) - (last x))\n        set [platform dy v] to ((new y) - (last y))\n    end\nend\ngo to x: (new x) y: (new y)\n\ndefine Door at (x) (y) key (key name)\nshow\nswitch costume to (key name)\ngo to [back v] layer\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        start sound [Buzz Whir v]\n        repeat (25)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Buzz Whir v]\n        repeat (25)\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 (player v)?>>\nend\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\n\nwhen I receive [about to change scene v]\ndelete this clone\n\ndefine Spawn (type) at (x) (y) dir (dir) turn (digrees)\nset [turn v] to (digrees)\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\ngo to [back v] layer\nif < (costume [name v]) contains [Key]?> then\n    Door at (x position) (y position) key (costume [name v])\nend\nif <(turn) > []> then\n    show\n    set rotation style [all around v]\n    forever\n        turn right (turn) degrees\n    end\nend\nif <(SCENE #) = [3]> then\n    Animate Platform\nend\nif <(SCENE #) = [104]> then\n    Animate platform1\nend\nif <(SCENE #) = [2]> then\n    Animate platform 2\nend\nif <(SCENE #) = [206]> then\n    Animate platform3\nend\nif <(SCENE #) = [205]> then\n    animate platform 4\nend\nif <(SCENE #) = [204]> then\n    animate platform 5\nend\nif <(SCENE #) = [108]> then\n    Animate platform 6\nend\n\ndefine rotaion maths ccw (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 [platform dx v] to ((((dx) * (cos)) - ((dy) * (sin))) - (dx))\nset [platform dy v] to ((((dx) * (sin)) + ((dy) * (cos))) - (dy))\n\ndefine Animate 4\n\ndefine Animate 2\nshow\nforever\n\ndefine Animate Platform\nshow\nforever\n    glide (1) secs to x: (x position) y: ((y position) - (150))\n    wait (0.5) seconds\n    glide (1) secs to x: (x position) y: ((y position) + (150))\n    wait (0.5) seconds\nend\n\nif <(SCENE #) = [3]> then\n    show\n    Spawn [platform2] at [172] [-21] dir [90]\nend\n\ndefine Animate platform\n\ndefine Animate platform\n\ndefine Animate platform3\nset size to (100) %\nshow\nswitch costume to (platform v)\nforever\n    glide (0.5) secs to x: (-22) y: (4)\n    wait (0.5) seconds\n    glide (1) secs to x: (162) y: (29)\n    wait (0.5) seconds\n    glide (1) secs to x: (0) y: (70)\n    wait (0.5) seconds\nend\n\ndefine Animate platform 2\nshow\nforever\n    glide (1) secs to x: (160) y: (-47)\n    wait (1) seconds\n    glide (1) secs to x: (87) y: (51)\n    wait (1) seconds\n    glide (1) secs to x: (2) y: (-49)\n    wait (1) seconds\nend\n\ndefine Animate platform1\nset size to (100) %\nshow\npoint in direction (90)\nforever\n    glide (1) secs to x: (x position) y: ((y position) + (200))\n    glide (1) secs to x: (x position) y: ((y position) - (200))\nend\n\nglide (1) secs to x: (-180) y: (140)\nglide (1) secs to x: (-180) y: (-50)\n\ndefine animate platform 4\nswitch costume to (platform1 v)\ngo to [back v] layer\nset size to (100) %\nshow\npoint in direction (90)\nforever\n    wait (0.5) seconds\n    glide (0.1) secs to x: (x position) y: ((y position) - (100))\n    start sound [Crunch v]\n    glide (1) secs to x: (x position) y: ((y position) + (100))\nend\n\nset size to (100) %\n\ndefine animate platform 5\nset size to (100) %\nshow\nswitch costume to (platform v)\nforever\n    glide (1.5) secs to x: (180) y: (-50)\n    wait (0.8) seconds\n    glide (1.5) secs to x: (-105) y: (-50)\n    wait (0.8) seconds\nend\n\ndefine Animate platform 6\nset size to (100) %\nshow\nswitch costume to (platform v)\ngo to [back v] layer\nforever\n    glide (1.5) secs to x: ((x position) + (200)) y: (y position)\n    wait (1) seconds\n    glide (1.5) secs to x: ((x position) - (200)) y: (y position)\n    wait (1) seconds\nend\n\nset size to (100) %\nshow\nswitch costume to (platform v)\ngo to x: (172) y: (-21)\nforever\n    glide (1.5) secs to x: (88) y: (46)\n    wait (1) seconds\n    glide (1.5) secs to x: (12) y: (-51)\n    wait (1) seconds\n    glide (1.5) secs to x: (172) y: (-21)\n    wait (1) seconds\nend\n\nSpawn [platform2] at [0] [70] dir [90]\n\nSpawn [platform2] at [0] [70] dir [90] turn []\n\nset size to (100) %\n\nset size to (100) %\n\nshow\n\nshow\n\nshow\n\nshow\n\nif <(SCENE #) = [4]> then\n    set size to (100) %\n    Spawn [Key 1] at [96] [84] dir [90] turn []\nend\n\nSpawn [Key 2] at [118] [103] dir [90] turn []\n\nSpawn [plank] at [-52] [-9] dir [90] turn [-5]\n\nwhen I receive [change scene v]\nswitch costume to (key 1 v)\ngo to [back v] layer\nhide\n\nif <(SCENE #) = [4]> then\n    set size to (100) %\n    Door at [96] [84] key [Key 1]\nend\nif <(SCENE #) = [307]> then\n    set size to (100) %\n    Door at [118] [103] key [Key 2]\nend\n\nhide\n\nglide (1) secs to x: (-70) y: (100)\n\nstart sound [Crunch v]\n\nswitch costume to (platform v)\npoint in direction (90)\ngo to x: (6) y: (-106)\n\nif <(SCENE #) = [206]> then\n    set size to (100) %\n    Spawn [platform2] at [0] [70] dir [90] turn []\nend\nif <(SCENE #) = [205]> then\n    set size to (100) %\n    Spawn [platform1] at [-70] [100] dir [90] turn []\nend\nif <(SCENE #) = [3]> then\n    set size to (100) %\n    Spawn [plank] at [60] [-9] dir [90] turn [2]\nend\nif <(SCENE #) = [204]> then\n    set size to (100) %\n    Spawn [platform] at [-105] [-50] dir [90] turn []\nend\nif <(SCENE #) = [307]> then\n    set size to (100) %\n    Spawn [Key 2] at [118] [103] dir [90] turn []\nend\nif <(SCENE #) = [206]> then\n    set size to (100) %\n    Spawn [platform] at [0] [70] dir [90] turn []\nend\nif <(SCENE #) = [104]> then\n    set size to (100) %\n    Spawn [platform] at [-180] [-70] dir [90] turn [0]\nend\n\ndefine Animate 3\n\n@Danger\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 (blank v)\nswitch costume to (join [Scene] (SCENE #))\ngo to [back v] layer\nhide\ngo to x: (0) y: (0)\nif <(SCENE #) = [1]> then\n    show\n    go to x: (0) y: (0)\nend\nif <(SCENE #) = [2]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [3]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [103]> then\n    show\n    go to x: (0) y: (0)\nend\nif <(SCENE #) = [101]> then\n    show\n    go to x: (0) y: (0)\nend\nif <(SCENE #) = [106]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [11]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [107]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [-90]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [111]> then\n    show\n    go to x: (0) y: (0)\nend\nif <(SCENE #) = [112]> then\n    show\n    go to x: (0) y: (0)\nend\nif <(SCENE #) = [8]> then\n    show\n    go to x: (0) y: (0)\nend\nif <(SCENE #) = [108]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\n\nset y to (0)\n\nforever\n    set y to ((5) * ([sin v] of ((timer) * (360)) ))\nend\n\nset y to ((5) * ([sin v] of ((timer) * (360)) ))\n\nforever\n    show\nend\n\nif <(SCENE #) = [2]> then\n    go to [back v] layer\n    switch costume to (scene205 v)\n    show\n    go to x: (0) y: (0)\nend\n\nswitch costume to (scene1 v)\n\nif <(SCENE #) = [101]> then\n    forever\n        show\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\n\nif <(SCENE #) = [104]> then\n    go to [back v] layer\n    switch costume to (scene106 v)\n    show\n    go to x: (0) y: (0)\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [206]> then\n    go to [back v] layer\n    switch costume to (scene206 v)\n    show\n    go to x: (0) y: (0)\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [205]> then\n    go to [back v] layer\n    switch costume to (scene205 v)\n    show\n    go to x: (0) y: (0)\nend\n\ngo to x: (0) y: (0)\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 x: (0) y: (0)\nswitch costume to (game over v)\ngo to [front v] layer\nshow\nbroadcast (Main Menu v)\n\nwhen I receive [start v]\nhide\n\n@Main Menu\n\nwhen I receive [main menu v]\nwait (0.1) seconds\nset [brightness v] effect to (0)\ngo to [front v] layer\nshow\ngo to x: (0) y: (-120)\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (40)\n        change size by ((0.2) * ((130) - (size)))\n        point in direction ((([sin v] of ((timer) * (250)) ) * (10)) + (90))\n    else\n        change size by ((0.2) * ((100) - (size)))\n        point in direction (((direction) - ((direction) / (10))) + (9))\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen this sprite clicked\nbroadcast (Start v)\nbroadcast (Reset Game v)\nhide\n\nwait (5) seconds\nbroadcast (Start NOW! v)\n\n@SCORE\n\nwhen flag clicked\nsetup\n\nwhen I start as a clone\n\nshow\nforever\n    change costume to (join [Glow-] (letter (index) of (☁ TIMER)))\n    set x to (((((index) - (0.5)) - ((length of (☁ TIMER)) / (2))) * ((size) / (2))) - (200))\nend\n\nchange size by ((0.2) * ((100) - (size)))\n\ndefine setup\nhide\nswitch costume to (glow-9 v)\nset size to (50) %\ngo to x: (0) y: (140)\nset [index v] to [1]\nrepeat (6)\n    create clone of (_myself_ v)\n    change x by ((size) / (2))\n    change [index v] by (1)\nend\n\ndefine change costume to (costume)\nif <not <(costume) = (costume [name v])>> then\n    switch costume to (costume)\n    set size to (50) %\nend\n\nset [lives v] to [200]\n\n@Sprite6\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I start as a clone\n\nrepeat (20)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [4 v]\n\nstart sound [pop v]\n\nwhen I receive [loadning v]\n\nshow\nswitch backdrop to (backdrop1 v)\nrepeat (30)\n    turn right (15) degrees\n    move (5) steps\n    create clone of (_myself_ v)\nend\nhide\nswitch backdrop to (pick random (1) to (10))\n\nrepeat (pick random (10) to (50))\nend\n\n@loadning\n\nwhen flag clicked\ngo to x: (0) y: (100)\nset size to (300) %\ngo to [front v] layer\nhide\n\nwhen I receive [1 v]\n\nwait (0.5) seconds\n\nwhen I receive [start v]\n\nwhen flag clicked\n\nwait (8) seconds\nbroadcast (Loadning v)\nswitch costume to (costume1 v)\nshow\nrepeat (3)\n    wait (0.3) seconds\n    next costume\nend\nhide\n\nbroadcast (Start NOW! v)\n\n@Background stuff\n\nwhen I start as a clone\nshow\ngo to [back v] layer\npoint in direction (pick random (-70) to (-100))\ngo to x: (300) y: (pick random (-180) to (180))\nset size to (pick random (10) to (15)) %\nset [ghost v] effect to (pick random (60) to (70))\ngo to [back v] layer\nrepeat until <<(x position) < [-220]> or <touching (sprite4 v)?>>\n    move (10) steps\nend\ndelete this clone\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nforever\n    hide\n    create clone of (_myself_ v)\nend\n\nif <(y position) < [-18-]> then\n    delete this clone\nend\n\n@Detector\n\ndefine Touching love or fav button?\nswitch costume to (love v)\nif <touching (mouse-pointer v)?> then\n    if <<(mouse x) < [-88]> and <(mouse x) > [-240]>> then\n        switch costume to (fav v)\n        if <touching (mouse-pointer v)?> then\n            set [touching fav button? v] to [true]\n            set [touching love button? v] to [false]\n        else\n            set [touching fav button? v] to [false]\n            set [touching love button? v] to [true]\n        end\n    else\n        set [touching fav button? v] to [false]\n        set [touching love button? v] to [false]\n    end\nelse\n    set [touching fav button? v] to [false]\n    set [touching love button? v] to [false]\nend\n\nwhen I receive [start now! v]\nset size to (0) %\ngo to x: (0) y: (0)\nset size to (100) %\nforever\n    Touching love or fav button?\nend\n\nwhen I receive [start now! v]\nset [countdown love v] to [20]\nforever\n    if <(touching love button?) = [true]> then\n        change [countdown love v] by (-1)\n        if <(Countdown love) = [0]> then\n            broadcast (thx love v)\n            stop [this script v]\n        end\n    else\n        if <<(touching love button?) = [false]> and <(Countdown love) < [12]>> then\n            broadcast (thx love v)\n            stop [this script v]\n        end\n        set [countdown love v] to [20]\n    end\nend\n\nwhen I receive [start now! v]\nset [touching fav button? v] to [20]\nforever\n    if <(touching fav button?) = [true]> then\n        change [countdown fav v] by (-1)\n        if <(Countdown fav) = [0]> then\n            broadcast (thx fav v)\n            stop [this script v]\n        end\n    else\n        if <<(touching fav button?) = [false]> and <(Countdown fav) < [12]>> then\n            broadcast (thx fav v)\n            stop [this script v]\n        end\n        set [countdown fav v] to [20]\n    end\nend\n\n@Thanks\n\nwhen flag clicked\nswitch costume to (- v)\nhide\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nset size to (0) %\nrepeat until <(size) > [119]>\n    change size by (((120) - (size)) / (8))\n    change [ghost v] effect by (-25)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [thx fav v]\nif <(costume [name v]) = [-]> then\n    go to x: (0) y: (-150)\n    switch costume to (fav v)\n    create clone of (_myself_ v)\n    switch costume to (- v)\nend\n\nwhen I receive [thx love v]\nif <(costume [name v]) = [-]> then\n    go to x: (0) y: (-100)\n    switch costume to (love v)\n    create clone of (_myself_ v)\n    switch costume to (- v)\nend\n\n@Intro\n\nwhen I start as a clone\nif <(Clone) = [Particles]> then\n    switch costume to (pick random (29) to (31))\n    set size to (pick random (50) to (150)) %\n    set [ghost v] effect to (pick random (0.) to (5.))\n    set [brightness v] effect to (pick random (-25.) to (100.))\n    go to x: (0) y: (0)\n    point in direction (pick random (-180) to (180))\n    set [x v] to (pick random (10.) to (12.))\n    set [i v] to (pick random (2.) to (9.))\n    go to [front v] layer\n    show\n    repeat until <touching (_edge_ v)?>\n        move (X) steps\n        change y by (I)\n        change [i v] by (-0.4)\n        set [x v] to ((X) * (0.95))\n    end\n    delete this clone\nend\n\ndefine Particles\nset [clone v] to [Particles]\nrepeat (50)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(Clone) = [Name]> then\n    switch costume to (name v)\n    set size to (50) %\n    clear graphic effects\n    go to [front v] layer\n    go to x: (0) y: (-100)\n    point in direction (0)\n    show\n    repeat (50)\n        go to [front v] layer\n        change size by (((130) - (size)) / (8))\n        change y by (((0) - (y position)) / (8))\n        turn right (((90) - (direction)) / (8)) degrees\n    end\n    set [i v] to [-1]\n    repeat (10)\n        go to [front v] layer\n        change size by (I)\n        change [i v] by (join [-] (([abs v] of (I) ) / (2)))\n        turn right (I) degrees\n    end\n    switch costume to (logo v)\n    repeat (40)\n        go to [front v] layer\n        change size by (((130) - (size)) / (8))\n        turn right (((90) - (direction)) / (8)) degrees\n    end\n    set [i v] to [-1]\n    repeat (20)\n        go to [front v] layer\n        change size by ((I) / (3))\n        change [i v] by (join [-] (([abs v] of (I) ) / (4)))\n        turn right ((I) / (-3)) degrees\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [Square]> then\n    clear graphic effects\n    show\n    set size to (0) %\n    go to x: (0) y: (300)\n    point in direction (0)\n    switch costume to (square v)\n    repeat (20)\n        change size by (((100) - (size)) / (5))\n        turn right (((90) - (direction)) / (5)) degrees\n        change y by (((0) - (y position)) / (5))\n    end\n    point in direction (90)\n    repeat (12)\n        next costume\n    end\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((2000) - (size)) / (5))\n        switch costume to (square13 v)\n    end\n    wait (3) seconds\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((100) - (size)) / (5))\n        switch costume to (square13 v)\n    end\n    repeat (12)\n        switch costume to ((costume [number v]) - (1))\n        change size by (-5)\n    end\n    set [i v] to [-1]\n    repeat (20)\n        change size by ((I) / (3))\n        change [i v] by (join [-] (([abs v] of (I) ) / (4)))\n        turn right ((I) / (-3)) degrees\n        change y by ((I) / (3))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [Bursts]> then\n    switch costume to (lineexplosion1 v)\n    clear graphic effects\n    go to [front v] layer\n    go [backward v] (1) layers\n    set [i v] to (pick random (1) to (3))\n    if <(I) = [1]> then\n        set [brightness v] effect to (100)\n    else\n        if <(I) = [2]> then\n            set [brightness v] effect to (25)\n        else\n            set [brightness v] effect to (-25)\n        end\n    end\n    show\n    set [i v] to [20]\n    Animate   x: [0] y: [0] size: [0] rotate: (pick random (-180) to (180)) speed: [1]\n    repeat (2)\n        set [i v] to ((I) * (0.9))\n        move (I) steps\n        Size: [100] speed: [5]\n    end\n    repeat (10)\n        set [i v] to ((I) * (0.9))\n        move (I) steps\n        Size: [100] speed: [5]\n        change [ghost v] effect by (10)\n        next costume\n    end\n    delete this clone\nend\n\ndefine Animate   x: (x) y: (y) size: (s) rotate: (r) speed: (s)\nchange x by (((round (x)) - (round (x position))) / (s))\nchange y by (((round (y)) - (round (y position))) / (s))\nchange size by (((round (s)) - (round (size))) / (s))\nturn right (((round (r)) - (round (direction))) / (s)) degrees\n\ndefine Spiral spline explosion\nset [clone v] to [Bursts]\nrepeat (5)\n    create clone of (_myself_ v)\nend\n\ndefine Size: (s) speed: (spd)\nchange size by (((round (s)) - (round (size))) / (spd))\n\ndefine Rect\nset [clone v] to [Rect]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone) = [Rect]> then\n    clear graphic effects\n    show\n    set size to (0) %\n    go to (random position v)\n    point in direction (90)\n    switch costume to (background rect v)\n    repeat until <(round (size)) = [300]>\n        change size by (((300) - (size)) / (15))\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [Circle]> then\n    clear graphic effects\n    set [brightness v] effect to (100)\n    go to [front v] layer\n    go [backward v] (2) layers\n    show\n    set size to (0) %\n    go to x: (0) y: (0)\n    point in direction (90)\n    switch costume to (circle explosion 1 v)\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((300) - (size)) / (5))\n        switch costume to (circle explosion 1 v)\n    end\n    delete this clone\nend\n\ndefine Circle\nset [clone v] to [Circle]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [clone v] to [Circle 2]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone) = [Circle 2]> then\n    clear graphic effects\n    set [brightness v] effect to (0)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\n    set size to (0) %\n    go to x: (0) y: (0)\n    point in direction (90)\n    switch costume to (circle explosion 1 v)\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((300) - (size)) / (5))\n        switch costume to (circle explosion 1 v)\n    end\n    delete this clone\nend\n\nwhen I receive [start v]\nbroadcast (Start NOW! v)\n\nreset timer\nhide\nstart sound [Prismo - Stronger v]\nset volume to (100) %\nclear graphic effects\nset size to (100) %\npoint in direction (90)\ngo to x: (0) y: (0)\nset [clone v] to [Square]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [clone v] to [Name]\ncreate clone of (_myself_ v)\nwait (0) seconds\nrepeat (2)\n    Spiral spline explosion\n    Particles\n    Rect\n    Spiral spline explosion\nend\nCircle\nrepeat (4)\n    Spiral spline explosion\n    Particles\n    Rect\n    Spiral spline explosion\nend\nCircle\nrepeat (2)\n    Spiral spline explosion\n    Rect\n    Spiral spline explosion\nend\n\n@TB\n\nwhen flag clicked\nhide\ngo to [front v] layer\nset [ghost v] effect to (100)\ngo to x: (-300) y: (0)\nforever\n    set [checktimer v] to (timer)\nend\n\nwhen [timer v] > (Checktimer)\nrepeat (30)\n    change [ghost v] effect by (0)\n    change x by (((0) - (x position)) / (3))\nend\n\nwhen I receive [start v]\nhide\n\nwhen I receive [start now! v]\nhide\n\n@Trampoline\n\nwhen flag clicked\nset [apples v] to [0]\ngo to x: (0) y: (0)\ngo to [back v] layer\nset size to (75) %\nhide\n\nwhen I receive [change scene v]\nswitch costume to (scene1 v)\nswitch costume to (join [Scene] (SCENE #))\nforever\nend\n\nif <(SCENE #) = [2]> then\n    show\n    go to x: (-100) y: (20)\n    if <touching (player v)?> then\n        if <([speed y v] of [player v]) < [-3]> then\n            start sound [Jump v]\n            broadcast (trampoline v)\n            repeat (4)\n                set costume trampoline\n            end\n        end\n    end\nelse\n    if <(SCENE #) = [1]> then\n        show\n        go to x: (54) y: (-62)\n        if <touching (player v)?> then\n            if <([speed y v] of [player v]) < [-3]> then\n                start sound [Jump v]\n                broadcast (trampoline v)\n                repeat (4)\n                    set costume trampoline\n                end\n            end\n        end\n    else\n        hide\n    end\nend\n\nhide\n\nset y to (0)\n\nforever\n    set y to ((5) * ([sin v] of ((timer) * (360)) ))\nend\n\ndefine set costume trampoline\nnext costume\n\nwait (0.0001) seconds\n\nif <(SCENE #) = [2]> then\n    show\n    go to x: (-100) y: (-80)\n    if <touching (player v)?> then\n        if <([speed y v] of [player v]) < [-3]> then\n            start sound [Jump v]\n            broadcast (trampoline v)\n            repeat (4)\n                set costume trampoline\n            end\n        end\n    end\nelse\n    hide\nend\n\n@sword\n\nwhen I receive [start now! v]\nset [sword? v] to [0]\nhide\nforever\n    if <(sword?) = [1]> then\n        go to (player v)\n        if <key (space v) pressed?> then\n            if <(weapon) = [sword]> then\n                start sound [High Whoosh v]\n                if <([direction v] of [player v]) = [90]> then\n                    go to (player v)\n                    show\n                    set [ghost v] effect to (0)\n                    point in direction (0)\n                    repeat (24)\n                        turn right (15) degrees\n                    end\n                    hide\n                else\n                    go to (player v)\n                    if <([direction v] of [player v]) = [-90]> then\n                        go to (player v)\n                        show\n                        set [ghost v] effect to (0)\n                        point in direction (0)\n                        repeat (24)\n                            turn left (15) degrees\n                        end\n                        hide\n                    end\n                end\n            end\n        end\n    end\nend\n\nchange [ghost v] effect by (2)\n\nchange [ghost v] effect by (2)\n\nturn right (15) degrees\n\nset [sword? v] to [1]\n\nwhen I receive [start now! v]\nforever\n    set size to (((APPLES) * (3)) + (100)) %\nend\n\nrepeat (2)\n    change [ghost v] effect by (50)\nend\n\nrepeat (2)\n    change [ghost v] effect by (50)\nend\n\nwhen I receive [start now! v]\nforever\n    go to (player v)\nend\n\nset [lives v] to [11111]\n\nstart sound [High Whoosh v]\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\nswitch costume to (blank v)\n\nswitch costume to (join [Scene] (SCENE #))\n\nset y to (0)\n\nset [ghost v] effect to (0)\n\nwhen I receive [start now! v]\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\ngo to [front v] layer\n\n@Sprite7\n\nwhen flag clicked\n\nwhen I start as a clone\npoint in direction (90)\ngo to (player v)\nclear graphic effects\nshow\nif <([direction v] of [player v]) = [90]> then\n    change x by (10)\n    repeat until <<touching (level v)?> or <touching (_edge_ v)?>>\n        turn right (20) degrees\n        change x by (8)\n    end\n    change x by (10)\nelse\n    change x by (-10)\n    repeat until <<touching (level v)?> or <touching (_edge_ v)?>>\n        turn right (-20) degrees\n        change x by (-8)\n    end\n    change x by (-10)\nend\nwait (0.5) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\n    if <not <touching (level v)?>> then\n        change y by (-4)\n    end\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [level change v]\ndelete this clone\n\nif <[] > [0]> then\nend\n\nwhen I receive [start now! v]\nset [weapon v] to [sword]\nset [ninja star? v] to [0]\nforever\n    if <key (space v) pressed?> then\n        if <(ninja star?) = [1]> then\n            if <(weapon) = [ninja star]> then\n                create clone of (_myself_ v)\n                change [ninja stars v] by (-1)\n                wait until <not <key (space v) pressed?>>\n            end\n        end\n    end\nend\n\nwhen [s v] key pressed\n\nwhen I receive [start now! v]\nset [apples v] to [0]\nforever\n    if <key (s v) pressed?> then\n        if <(weapon) = [ninja star]> then\n            set [weapon v] to [sword]\n            wait until <not <key (s v) pressed?>>\n        else\n            set [weapon v] to [ninja star]\n            wait until <not <key (s v) pressed?>>\n        end\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\n\nwhen [s v] key pressed\n\nnext costume\n\n\n    next costume\nend\n\nwait until <not <key (s v) pressed?>>\n\n\nend\n\nwhen flag clicked\n\nwhen I receive [start now! v]\ngo to x: (-124) y: (151)\nhide\nforever\n    if <not <<(ninja star?) = [1]> or <(sword?) = [1]>>> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    if <<(ninja star?) = [1]> and <(weapon) = [ninja star]>> then\n        switch costume to (ninja star v)\n    end\n    if <<(sword?) = [1]> and <(weapon) = [sword]>> then\n        switch costume to (sword v)\n    end\nend\n\n@Love and fave reminder\n\nwhen I receive [intro v]\n\nwhen flag clicked\nhide\ngo to x: (-6) y: (105)\n\nwhen flag clicked\n\nwhen I receive [start now! v]\nhide\ngo to [front v] layer\nforever\n    wait (pick random (15) to (35)) seconds\n    switch costume to (costume1 v)\n    go to x: (0) y: (105)\n    show\n    go to [front v] layer\n    repeat (9)\n        change y by (-6)\n    end\n    repeat (5)\n        change y by (3)\n    end\n    repeat (5)\n        change y by (-1)\n    end\n    wait (2) seconds\n    repeat (15)\n        change y by (7)\n    end\n    hide\nend\n\n@Detector Boosts\n\nwhen flag clicked\n\nwhen I start as a clone\nif <(clone id2) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id2) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\nwhen I receive [start now! v]\nhide\nset [clone id2 v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id2 v] to [1]\ncreate clone of (_myself_ v)\nforever\n    set [timer v] to [0]\n    wait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\n    wait (1) seconds\n    if <[lovenfave? v] contains (username)?> then\n        set [timer v] to [0]\n        delete (item # of (username) in [lovenfave? v]) of [lovenfave? v]\n        set [loved__ v] to [0]\n        set [faved___ v] to [0]\n        go to [front v] layer\n        show\n        go to x: (0) y: (-100)\n        set [timer v] to [0]\n        switch costume to (:\( v)\n        set [ghost v] effect to (100)\n        change [acceleration v] by (-0.7)\n        change [jump force v] by (-1.5)\n        set [lovenfavejump v] to [0]\n        set [lovenfavespeed v] to [0]\n        repeat until <(Timer) > [3.5]>\n            change y by ((y position) / (-15))\n            change [ghost v] effect by (-3)\n        end\n        set [timer v] to [0]\n        repeat until <(Timer) > [3.5]>\n            change y by (((y position) - (-100)) / (-15))\n            change [ghost v] effect by (10)\n        end\n    else\n        add (username) to [lovenfave? v]\n        set [loved__ v] to [0]\n        set [faved___ v] to [0]\n        go to [front v] layer\n        show\n        go to x: (0) y: (-100)\n        set [timer v] to [0]\n        switch costume to (:\) v)\n        set [ghost v] effect to (100)\n        change [acceleration v] by (0.7)\n        change [jump force v] by (1.5)\n        set [lovenfavejump v] to [0.5]\n        set [lovenfavespeed v] to [0.1]\n        repeat until <(Timer) > [3.5]>\n            change y by ((y position) / (-15))\n            change [ghost v] effect by (-3)\n        end\n        set [timer v] to [0]\n        repeat until <(Timer) > [3.5]>\n            change y by (((y position) - (-100)) / (-15))\n            change [ghost v] effect by (10)\n        end\n    end\nend\n\nwhen I receive [start now! v]\nforever\n    set [check v] to (Timer)\nend\n\nwhen I receive [start now! v]\nset [timer v] to [0]\nforever\n    change [timer v] by (.0297)\nend\n\nwhen I receive [start now! v]\n\n@Control stick\n\nwhen flag clicked\ngo to [front v] layer\nset [myself v] to [Control stick]\nset size to (100) %\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 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\nwhen flag clicked\nset [stick power v] to [0]\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\n@Griffpatch?\n\nwhen I receive [start now! v]\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (0)\nforever\n    if <<(username) = [griffpatch_tutor]> or <(username) = [griffpatch]>> then\n        change [☁ griffpatch v] by (1)\n        broadcast (Griffpatch v)\n    end\n    if <(username) = [Will_Wam]> then\n        change [☁ griffpatch v] by (1)\n    end\nend\n\nwait until <not <<(username) = [griffpatch_tutor]> or <(username) = [griffpatch]>>>\n\nwhen I receive [griffpatch v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nshow\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (0)\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (0)\n\nwait until <not <(username) = [Will_Wam]>>\n\n@Sprite1\n\nwhen flag clicked\nset [cos1 v] to [0]\nset [ghost v] effect to (100)\n\nwhen I start as a clone\nif <(costume [name v]) = [eyes]> then\n    point in direction (90)\n    go to [front v] layer\n    forever\n        change [ghost v] effect by (-10)\n        go to x: ((([x position v] of [player v]) / (25)) + (bossX)) y: ((([cos v] of ((cos1) * (5)) ) * (12)) + (bossY))\n        change [cos1 v] by (1)\n    end\nend\nif <(costume [name v]) = [lower jaw]> then\n    go to [back v] layer\n    forever\n        change [ghost v] effect by (-10)\n        go to x: (bossX) y: (((0) - ((([cos v] of ((cos1) * (5)) ) * (3)) + (10))) + (bossY))\n        change [cos1 v] by (1)\n    end\nend\n\nwhen I receive [boss v]\nset [bossx v] to [0]\nset [bossy v] to [50]\nwait (1) seconds\nset size to (400) %\nset [cos1 v] to [0]\nswitch costume to (eyes v)\ncreate clone of (_myself_ v)\nswitch costume to (lower jaw v)\ncreate clone of (_myself_ v)\nswitch costume to (upper jaw v)\nforever\n    change [ghost v] effect by (-10)\n    go to x: (bossX) y: ((([cos v] of ((cos1) * (5)) ) * (12)) + (bossY))\n    set [bossx v] to (([cos v] of ((cos1) * (2.5)) ) * (70))\n    change [cos1 v] by (1)\nend\n\nwhen I receive [end boss v]\nrepeat (100)\n    change size by (1)\n    change [brightness v] effect by (1)\nend\n\nwhen I receive [game over v]\nset [ghost v] effect to (100)\nstop [other scripts in sprite v]\ndelete this clone\n\n@Health bar\n\nwhen flag clicked\nhide\ndelete all of [heaths v]\n\nwhen I start as a clone\nset x to (item (1) of [heaths v])\nset y to (item (2) of [heaths v])\nswitch costume to ((10) * (item (3) of [heaths v]))\nif <<(LIVES) = (max health)> or <(LIVES) > (max health)>> then\n    switch costume to (h10 v)\nend\ndelete (1) of [heaths v]\ndelete (1) of [heaths v]\ndelete (1) of [heaths v]\nif <<not <touching (_edge_ v)?>> and <(sh) = []>> then\n    go to [front v] layer\n    show\n    wait (0) seconds\nend\ndelete this clone\n\ndefine Show Health (health) of (max) offset y (y)\nadd (x position) to [heaths v]\nadd ((y position) + (y)) to [heaths v]\nadd ((health) / (max)) to [heaths v]\ncreate clone of (health bar v)\n\nwhen I receive [hide health v]\nhide\nset [sh v] to [1]\n\nwhen I receive [start now! v]\nset [sh v] to []\n\n@Sprite3\n\nwhen I receive [start v]\ngo to x: (0) y: (-50)\nforever\n    if <(SCENE #) = [-288]> then\n        if <touching (player v)?> then\n            broadcast (boss v)\n            hide\n            stop [this script v]\n        end\n        show\n    else\n        hide\n    end\nend\n\n@attacks\n\ndefine attack type (type) (x) (y) (dir) (life)\ngo to x: (x) y: (y)\npoint in direction (dir)\nif <(type) = [spike]> then\n    switch costume to (spike v)\n    set [life v] to (life)\n    create clone of (_myself_ v)\nend\nif <(type) = [fall]> then\n    switch costume to (fall v)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset size to (100) %\nset [color v] effect to (0)\n\ndefine damage\nif <touching (player v)?> then\n    change [lives v] by (-1)\n    delete this clone\nend\n\nbroadcast (Lose Life v)\n\nwhen I receive [boss v]\nshow variable [lives v]\nset [enemycount v] to [0]\nset [ghost v] effect to (100)\nbroadcast (Hide health v)\nwait (5) seconds\nrepeat (2)\n    repeat (10)\n        attack type [spike] ([x position v] of [player v]) [] [0] [0.5]\n        wait (1) seconds\n    end\n    wait (1) seconds\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (220)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (190)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (160)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (130)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (100)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (70)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (40)) [] [0] [0.5]\n    wait (1) seconds\nend\nwait (1) seconds\nrepeat (15)\n    attack type [fall] (pick random (-200) to (200)) [180] [] []\n    wait (0.15) seconds\nend\nbroadcast (boss-right v)\nset [x_c v] to [220]\nrepeat (22)\n    change [x_c v] by (-20)\n    attack type [spike] (X_c) [] [0] [0.1]\nend\nbroadcast (boss-mid v)\nwait (1) seconds\nrepeat (15)\n    attack type [fall] (pick random (-200) to (200)) [180] [] []\n    wait (0.15) seconds\nend\nbroadcast (boss-left v)\nset [x_c v] to [-220]\nrepeat (22)\n    change [x_c v] by (20)\n    attack type [spike] (X_c) [] [0] [0.1]\nend\nbroadcast (boss-mid v)\nrepeat (2)\n    repeat (20)\n        attack type [spike] ([x position v] of [player v]) [] [0] [0.5]\n        wait (0.5) seconds\n    end\n    wait (0.5) seconds\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (220)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (190)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (160)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (130)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (100)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (70)) [] [0] [0.5]\n    attack type [spike] ((([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) * (40)) [] [0] [0.5]\n    wait (0.5) seconds\nend\nwait (1) seconds\nbroadcast (end boss v)\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen I start as a clone\nset size to (100) %\nset [ghost v] effect to (0)\nif <(costume [name v]) = [spike]> then\n    set [ghost v] effect to (70)\n    go to [back v] layer\n    set y to (-100)\n    wait (1) seconds\n    set y to (-200)\n    set [ghost v] effect to (0)\n    repeat (10)\n        change y by (10)\n        damage\n    end\n    repeat (life)\n        wait (0) seconds\n        damage\n    end\n    repeat (10)\n        change y by (-10)\n        damage\n    end\n    delete this clone\nend\nif <(costume [name v]) = [fall]> then\n    go to [back v] layer\n    set [ghost v] effect to (100)\n    set [turn v] to (pick random (-7) to (7))\n    repeat (10)\n        turn right (turn) degrees\n        change [ghost v] effect by (-10)\n        change y by (-8)\n        damage\n    end\n    repeat until <touching (_edge_ v)?>\n        turn right (turn) degrees\n        change y by (-8)\n        damage\n    end\n    delete this clone\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [start now! v]\nhide variable [lives v]\n\n@Sprite4\n\nwhen I receive [end boss v]\nrepeat (100)\n    change [ghost v] effect by (-1)\n    go to [front v] layer\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\n@Sprite5\n\nwhen flag clicked\nset [ghost v] effect to (100)\nwait (0) seconds\ngo to [front v] layer\nshow\n\n