Classic Platformer - Mobile Friendly
@Stage\n\n@Blank\n\n@Player\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 - Ceiling Or Floor\n    end\nend\n\ndefine Controls - Left And Right\nif <(Long Jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [key x v] to (<<key (right arrow v) pressed?> or <(STICK X) > [0.5]>> - <<key (left arrow 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.98))\n        stop [this script v]\n    end\n    if <([abs v] of (Speed X) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed x v] by ((Key X) * (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\ndefine Controls - Up And Down\nif <<key (up arrow 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\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 X) ) + ([abs v] of (Speed Y) ))\nSet Costume\n\nwhen I receive [game loop v]\nset [ghost v] effect to (0)\nforever\n    broadcast (Tick - First v)\n    broadcast (Ticks - Platforms v)\n    broadcast (Tick - Player v)\n    broadcast (Tick - Last v)\nend\n\nwhen I receive [tick - last v]\nif <(x position) > [235]> then\n    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 v2 v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    Fix Collision In Direction [0]\nelse\n    Fix Collision In Direction [90]\nend\nSet Costume\nbroadcast (Game Loop v)\n\ndefine Fix Collision 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\ndefine Reset And Begin\nset [invulnerable v] to [0]\nset [speed y v] to [0]\nset [speed x 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)\nBegin Scene (Spawn Scene) Go To X,Y: (Spawn X) (Spawn Y)\n\nwhen flag clicked\nbroadcast (Main Menu v)\nhide\n\ndefine Check Touching Solid\nif <<touching (level v)?> or <touching (platform v)?>> then\n    set [touching v] to [1]\n    stop [this script v]\nend\nset [touching v] to [0]\nset [hit costume v] to (costume [name v])\nif <(Hit Costume) = [hitbox v2]> then\n    switch costume to (hitbox feet v)\nend\nif <touching (jump through v)?> then\n    if <(Jump Through) < [1]> then\n        change y by (-6)\n        if <(Hit Costume) = [hitbox v2]> then\n            switch costume to (hitbox feet2 v)\n        end\n        if <touching (jump through v)?> then\n            set [touching v] to [1]\n        else\n            set [jump through v] to [1]\n        end\n        change y by (6)\n    end\nelse\n    set [jump through v] to [0]\nend\nswitch costume to (Hit Costume)\n\nwhen I receive [tick - first v]\nset [platform dx v] to []\nset [platform dy v] to []\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\ndefine Set Costume\nset rotation style [left-right v]\nif <(Wall Slide) > [0]> then\n    switch costume to (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 - Ceiling 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 I receive [lose life v]\nset [invulnerable v] to [1]\nstop [other scripts in sprite v]\nstart sound [Oops v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nchange [lives v] by (-1)\nif <(Lives) > [0]> then\n    Reset And Begin\nelse\n    broadcast (Game Over v)\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 [10]\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 I receive [start game v]\nshow\npoint in direction (90)\nset [gravity v] to [-1.5]\nset [jump force v] to [15]\nset [jump duration v] to [6]\nset [acceleration v] to [1.5]\nset [resistance v] to [0.8]\nbroadcast (Reset Game v) and wait\nbroadcast (Set Up v) and wait\nset [lives v] to [3]\nset [spawn scene v] to [1]\nset [spawn x v] to [-160]\nset [spawn y v] to [30]\nReset And Begin\n\nwhen I receive [player bounce v]\nset [speed y v] to [10]\n\n@Enemy\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [change scene v]\nif <(SCENE#) = [1]> then\n    Spawn [Red] at [30] [6] dir [-90]\n    Spawn [Red] at [90] [62] dir [90]\nend\nif <(SCENE#) = [99]> then\n    Spawn [Red] at [172] [111] dir [-90]\n    Spawn [Red] at [175] [-78] dir [-90]\nend\nif <(SCENE#) = [101]> then\n    Spawn [Red] at [174] [-61] dir [-90]\nend\nif <(SCENE#) = [4]> then\n    Spawn [Red] at [176] [-87] dir [-90]\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 (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\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)?> or <touching (jump through v)?>>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\ndefine Move Left Or Right\nmove (2) steps\nrepeat (4)\n    if <not <<touching (level v)?> or <touching (_edge_ v)?>>> then\n        if <not <<touching (safe zone v)?> or <touching (platform v)?>>> then\n            if <not <touching (jump through 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 (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 (10)\n    end\n    delete this clone\nend\nbroadcast (Lose Life v)\n\ndefine Spawn (type) at (x) (y) dir (dir)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\n@Level\n\nwhen flag clicked\nhide\nerase all\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE#))\nStamp Shadow\nStamp Outline\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-20)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen I receive [start game v]\nshow\n\nwhen I receive [about to change scene v]\nerase all\n\n@Jump Through\n\nwhen flag clicked\nhide\nerase all\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#))\nStamp Shadow\nStamp Outline\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-10)\nstamp\nchange y by (10)\nclear graphic effects\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-20)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen I receive [start game v]\nshow\n\n@Danger\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [change scene v]\ngo to [back v] layer\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE#))\nif <(SCENE#) = [0]> then\n    forever\n        set y to ((3) * ([sin v] of ((timer) * (170)) ))\n    end\nend\nif <(SCENE#) = [2]> then\n    forever\n        set y to ((3) * ([sin v] of ((timer) * (170)) ))\n    end\nend\n\nwhen I receive [start game v]\nshow\n\n@Lives\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\nwhen I receive [start game v]\ngo to x: (0) y: (0)\nswitch costume to (3 v)\nshow\n\nwhen I receive [lose life v]\nrepeat (2)\n    change y by (2)\n    change [brightness v] effect by (20)\n    wait (0.1) seconds\n    change [brightness v] effect by (-20)\n    change y by (-2)\nend\nswitch costume to ((costume [number v]) + (1))\n\n@Platform\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE#) = [-1]> then\n    Spawn [rectangle] at [0] [-15] dir [90] turn [3]\n    Spawn [key 4] at [178] [-71] dir [90] turn []\nend\nif <(SCENE#) = [0]> then\n    Spawn [circle] at [-130] [-45] dir [90] turn [1]\nend\nif <(SCENE#) = [2]> then\n    Spawn [square] at [-23] [-63] dir [90] turn [-5]\n    Spawn [key 1] at [146] [-30] dir [90] turn []\nend\nif <(SCENE#) = [3]> then\n    Spawn [key 2] at [100] [-30] dir [90] turn []\nend\nif <(SCENE#) = [4]> then\n    Spawn [key 3] at [26] [20] dir [90] turn []\nend\n\ndefine Animate Platform\nshow\nforever\n    glide (1) secs to x: (x position) y: ((y position) - (90))\n    wait (0) seconds\n    glide (1) secs to x: (x position) y: ((y position) + (90))\n    wait (0) seconds\nend\n\nwhen I receive [ticks - 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        Rotation 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 Animate 2 \ngo to x: (-28) y: (-90)\nforever\n    glide (2) secs to x: (100) y: (-90)\n    wait (0.5) seconds\n    glide (2) secs to x: (-28) y: (-90)\n    wait (0.5) seconds\nend\n\ndefine Door at (x) (y) Key (key name) X OR Y (x or y) Animation Duration (animate duration)\nshow\nswitch costume to (key name)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        if <(animate duration) > [24]> then\n            start sound [Buzz Whir2 v]\n        else\n            start sound [Buzz Whir v]\n        end\n        repeat (animate duration)\n            if <(x or y) = [y]> then\n                change y by (4)\n            else\n                change x by (4)\n            end\n        end\n        wait (1) seconds\n        if <(animate duration) > [24]> then\n            start sound [Buzz Whir2 v]\n        else\n            start sound [Buzz Whir v]\n        end\n        repeat (animate duration)\n            if <(x or y) = [y]> then\n                change y by (-4)\n            else\n                change x by (-4)\n            end\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\nset rotation style [left-right v]\nhide\n\nwhen I receive [about to change scene v]\ndelete this clone\n\ndefine Spawn (type) at (x) (y) dir (dir) turn (degrees)\nset [turn v] to (degrees)\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\nif < (costume [name v]) contains [key]?> then\n    if <(SCENE#) = [2]> then\n        Door at (x position) (y position) Key [key 1] X OR Y [y] Animation Duration [60]\n    end\n    if <(SCENE#) = [3]> then\n        Door at (x position) (y position) Key [key 2] X OR Y [y] Animation Duration [24]\n    end\n    if <(SCENE#) = [4]> then\n        Door at (x position) (y position) Key [key 3] X OR Y [x] Animation Duration [24]\n    end\n    if <(SCENE#) = [-1]> then\n        Door at (x position) (y position) Key [key 4] X OR Y [y] Animation Duration [24]\n    end\nend\nif <(turn) > []> then\n    show\n    set rotation style [all around v]\n    forever\n        turn right (turn) degrees\n    end\nend\nAnimate Platform\n\ndefine Rotation 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\n@Collectables\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) * ([cos v] of (frame) ))\n    change [frame v] by (5)\nend\nset [my scene v] to []\nif <(costume [name v]) = [apple]> then\n    start sound [Chomp v]\n    change [apples v] by (1)\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 v] of [player v])\n        set [spawn y v] to ([y position v] of [player v])\n    else\n        if <<(costume [name v]) = [apple big1]> or <(costume [name v]) = [apple big2]>> then\n            start sound [Chomp2 v]\n            change [apples v] by (5)\n        else\n            start sound [Wand v]\n            add (costume [name v]) to [collected v]\n        end\n    end\nend\nrepeat (20)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [set up v]\ndelete all of [collected v]\nset [frame v] to [0]\nset [apples v] to [0]\nhide\nPlace [apple] Scene [99] X,Y [-148] [37]\nPlace [apple] Scene [99] X,Y [-155] [-75]\nPlace [apple big2] Scene [99] X,Y [155] [125]\nPlace [key 4] Scene [0] X,Y [-131] [55]\nPlace [apple] Scene [1] X,Y [-85] [-99]\nPlace [apple] Scene [2] X,Y [-24] [28]\nPlace [apple] Scene [2] X,Y [-162] [-91]\nPlace [Green Flag] Scene [2] X,Y [85] [-91]\nPlace [Green Flag] Scene [103] X,Y [-175] [81]\nPlace [apple] Scene [101] X,Y [-42] [-73]\nPlace [apple] Scene [101] X,Y [70] [35]\nPlace [key 1] Scene [101] X,Y [178] [-70]\nPlace [key 2] Scene [103] X,Y [123] [38]\nPlace [key 3] Scene [4] X,Y [178] [-77]\nPlace [apple big1] Scene [104] X,Y [-148] [26]\nPlace [Green Flag] Scene [104] X,Y [172] [63]\nPlace [apple] Scene [204] X,Y [-167] [99]\nPlace [apple] Scene [204] X,Y [167] [99]\nPlace [apple] Scene [204] X,Y [167] [-99]\n\ndefine Place (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\n@Control Stick\n\nwhen flag clicked\ngo to x: (166) y: (-106)\nhide\n\nwhen I start as a clone\nswitch costume to (stick v)\ngo to [front v] layer\nset [ghost v] effect to (50)\nforever\n    set [stick power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (myself)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) * (0.6))> then\n        Stick Drag\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\ndefine Stick Drag\nrepeat until <not <mouse down?>>\n    go to (mouse-pointer v)\n    point towards (myself)\n    turn right (180) degrees\n    set [stick direction v] to (direction)\n    set [stick power v] to (distance to [(myself) v])\n    if <(STICK POWER) > (max stick)> then\n        move ((max stick) - (STICK POWER)) steps\n        set [stick power v] to (max stick)\n    end\n    set [stick power v] to ((STICK POWER) / (max stick))\n    set [stick x v] to ((STICK POWER) * ([sin v] of (STICK DIRECTION) ))\n    set [stick y v] to ((STICK POWER) * ([cos v] of (STICK DIRECTION) ))\nend\n\nwhen I receive [start game v]\nwait (0) seconds\nshow\ngo to [front v] layer\nset [myself v] to [Control Stick]\nset size to (150) %\nset [max stick v] to ((size) / (4))\nswitch costume to (base v)\nset [ghost v] effect to (70)\ncreate clone of (_myself_ v)\n\nwhen I receive [start game v]\ndelete this clone\n\n@Animation\n\nwhen flag clicked\ngo to x: (0) y: (-205)\nhide\n\nwhen I receive [start game v]\nshow\nforever\n    go to [front v] layer\n    wait (8) seconds\n    glide (0.5) secs to x: (0) y: (-150)\n    wait (2) seconds\n    glide (0.5) secs to x: (0) y: (-205)\nend\n\n@Splash Screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (title screen1 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 game v]\nhide\n\n@Safe Zone\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nset [ghost v] effect to (100)\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE#))\n\n@Counter\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nforever\n    change costume to (join [Number-] (letter (index) of (Apples)))\n    set x to (210)\n    change x by ((((index) - (0.5)) - ((length of (Apples)) / (1.8))) * ((size) / (3.3)))\n    change size by ((0.2) * ((100) - (size)))\nend\n\ndefine setup\nhide\nswitch costume to (number-9 v)\nset size to (100) %\nset [index v] to [1]\nrepeat (2)\n    create clone of (_myself_ v)\n    change x by ((size) / (3.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 (120) %\nend\n\nwhen I receive [start game v]\nsetup\n\n@Main Menu\n\nwhen I receive [main menu v]\nwait (0.1) seconds\nswitch backdrop to (false v)\ngo to [front v] layer\nshow\nset size to (10) %\ngo to x: (0) y: (-40)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((90) - (size)))\n    else\n        change size by ((0.2) * ((80) - (size)))\n    end\n    change [animate speed v] by (6)\n    point in direction ((([sin v] of (animate speed) ) * (4)) + (90))\n    change y by (([sin v] of (animate speed) ) * (0.4))\nend\n\nwhen flag clicked\nset [animate speed v] to [0]\nhide\n\nwhen this sprite clicked\nbroadcast (Start Game v)\nhide\n\n
Use Arrow Keys To Move In PC or Use The Joystick In Mobile.