Dark Kingdom (Dark Realm) A Platformer V1.7

Instructions:                        SPAM THE GREEN FLAG!!!                  After 45+ hours of hard work, I present to you... Dark Kingdom! Please love, favorite, and follow @nxgamesco! I hope you enjoy! At 2.5k views and 25 follows i'll make a part 2! Comment any bugs you found and comment any features that you would want in the game.\n==========================================\n                        ★★★ STORY ★★★\nYou wake up and you are in a kingdom a dark kingdom. The kingdom is very dangerous and filled with many spikes and lava. Explore the kingdom and try to escape. Collect coins and keys on the way! Watch out for moving platforms. Open the door with the key to escape and watch out because you might not make it out.\n==========================================\n                   ★★★ CONTROLS ★★★\nArrow keys, ADSW, and space to move and jump \nYou could get crush by moving platforms\nCollect the key to open the locked door\nGo through the door to escape\nS to show Lives and Coins\nH to hide Lives and Coins\nWall Jump - by touching a wall and pressing 'up'\nJump Higher - by holding up for longer\nIf the game is glitchy then click the green flag\n==========================================\n                           ★★★ Features ★★★\n* Wall sliding\n* Gravity, Velocity, Friction\n* Slope detection - steep slopes slow movement\n* Wall Jumping\n* Animated player\n* Moving / Rotating platforms \n* Glow around player\n* Floating particles\n*  Working key door\n* Player death when touching 'hurt' sprites\n* Checkpoints\n* Coins\n* Working key\n* Spikes\n* Lives\n* Main Menu\n*Moving lava\n ==========================================                            \n                           ★★★ NOTE ★★★\nThis project is still a work in progress.\n What I will add:\n- More levels and make the levels better\n- More moving platforms\n- Hidden walls\n- More coins\n- More sound effects\n- A lot more\nThe final version will be out soon\n==========================================\n                    ★★★ UPDATES ★★★\n6 Jan 2022 - v1.0 - Initial Release \n6 Jan 2022 - v1.1 - ADSW Controls\n7 Jan 2022 - v1.2 - More sound effects\n8 Jan 2022 - v1.3 - Graphic effects\n9 Jan 2022 - v1.4 - Graphics, Coins\n10 Jan 2022 - v1.5 - Graphics\n11 Jan 2022 - v1.6 - easy mode\n15 Jan 2022 - v1.7 - improved ending\n==========================================\n                      ★★★ CREDITS ★★★\n- @Griffpatch for the Classic Platformer Tutorial\n- @Griffpatch for the cat costumes\n- Background Music - From "A boy and his light"\n-Coins, keys, and door sounds from scratch\n- Everything else by me\n==========================================\n#games #Dark #Kingdom #Calm #Trending #Fun #nxgamesco #trending #games #games #games #games #art #platformer #platformer #darkrealm #realm #games #games #games #games #games  #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #games #Games #All #Stories #Art #animation #Music #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #All #Music #Music #Music #Music #Music #Music#Music #Music #Music #Music #Music#Music #Music #Music #Music #Music#Music #Music #Music #Music #Music#Music #Music #Music #Music #Music#Music #Music #Music #Music #Music#Music #Music #Music #Music #Music#Music #Music #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Stories #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Art #Animations #Animations #Animations #Animations #Animations #Animations #Animations #Animations #Animations#Animations #Animations #Animations #Animations #Animations #Animations #Animations #Animations#Animations #Animations #Animations #Animations #Animations #Animations #Animations #Animations#Animations #Animations #Animations #Animations #Animations #Animations #Animations #Animations#Animations #Animations #Animations #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials #Tutorials 

@Stage\n\nwhen flag clicked\nforever\n    play sound [Council of NineChimes of the unfortunate v] until done\nend\n\nwhen flag clicked\nif <(SCENE #) = [16]> then\n    switch backdrop to (endy v)\n    broadcast (end v)\nend\n\nwhen I receive [end v]\nforever\n    switch backdrop to (endy v)\nend\n\n@Player\n\nwhen flag clicked\nbroadcast (Main Menu v)\nset [pixelate v] effect to (0)\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 - Ceilling or Floor\n    end\nend\n\ndefine Check Touching Solid\nif <<touching (level v)?> or <<touching (platforms v)?> or <touching (platforms2 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 x) ) + ([abs v] of (speed y) ))\nSet Costume\n\ndefine Controls - Up and down\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <key (space v) pressed?>>> then\n    if <<(wall slide) > [0]> and <(jumping) = [0]>> then\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        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?>> - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\nif <(KEY X) = [0]> then\n    if <<(falling) > [2]> and <(wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.98))\n        stop [this script v]\n    end\n    if <([abs v] of (speed x) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed x v] by ((KEY X) * (ACCELERATION))\n    point in direction ((KEY X) * (90))\n    change [frame v] by (1)\nend\nset [speed x v] to ((speed x) * (RESISTANCE))\n\ndefine Reset and Begin Level\nset [speed x 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 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)\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    start sound [spike 2 v]\n    broadcast (Loose Life v)\nend\nif <touching (danger2 v)?> then\n    start sound [lava sound effect v]\n    broadcast (Loose 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 (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 (313)\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.9))\nSlip\n\ndefine Collide Y - Ceilling 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 [loose life v]\nchange [lives v] by (-1)\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nif <(LIVES) > [0]> then\n    Reset and Begin Level\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 [16]\n    if <(touching) > [0]> then\n        broadcast (Loose 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]\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 (setup v) and wait\nset [spawn scene v] to [1]\nset [spawn x v] to [-150]\nset [spawn y v] to [55]\nReset and Begin Level\n\nwhen I receive [game over v]\nstart sound [Lose v]\n\nwhen [up arrow v] key pressed\nplay sound [High Whoosh v] until done\nwait (0.5) seconds\n\nwhen [w v] key pressed\nplay sound [High Whoosh v] until done\nwait (0.5) seconds\n\nwhen [space v] key pressed\nplay sound [High Whoosh v] until done\nwait (0.5) seconds\n\nwhen I receive [start game v]\nset [lives v] to [5]\nshow variable [lives v]\n\nwhen flag clicked\nhide variable [lives v]\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 #))\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 (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\nwhen flag clicked\nset instrument to (6 v)\nchange tempo by (0)\nset tempo to (60)\n\nwhen flag clicked\nset language to (en v)::tts\nset voice to (alto v)::tts\n\nwhen I receive [start game v]\nwait (0.6) seconds\nstart sound [knock v]\n\n@Sprite1\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (.5) seconds\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (pick random (40) to (70))\nset size to (pick random (30) to (70)) %\ngo to (player v)\nglide (5) secs to (random position v)\nrepeat (48)\n    change [ghost v] effect by (5)\nend\n\nwhen I receive [game over v]\nhide\nbroadcast (Main Menu v)\n\n@Sprite2\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    go to (player v)\nend\n\nwhen I receive [game over v]\nhide\n\nwhen flag clicked\nshow\nif <(SCENE #) = [16]> then\n    forever\n        hide\n        hide variable [lives v]\n        hide variable [coins v]\n        hide\n    end\nend\n\nwhen I receive [start game v]\nshow\nforever\n    go to (player v)\nend\n\n@Sprite3\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nglide (2) secs to x: (0) y: (0)\nhide\n\nwhen flag clicked\nshow\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 #))\n\n@Danger2\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 #))\nif <(SCENE #) = [5]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [6]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [8]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [9]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [10]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [104]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [11]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [12]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [13]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [14]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [104]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [113]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\nif <(SCENE #) = [15]> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\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]) = [Coin]> then\n    start sound [Coin v]\n    change [coins v] by (1)\n    switch backdrop to (coin backround v)\n    switch backdrop to (backroundy v)\nelse\n    if <(costume [name v]) = [Checkpoint]> then\n        change [lives v] by (1)\n        start sound [Collect v]\n        switch backdrop to (main backroung 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        switch backdrop to (backroundy v)\n    else\n        start sound [Wand v]\n        add (costume [name v]) to [collected v]\n    end\nend\nrepeat (20)\n    change y by (2)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [setup v]\ndelete all of [collected v]\nset [frame v] to [0]\nset [coins v] to [0]\nset [lives v] to [5]\nhide\nplace [coin] scene [104] xy [-157] [30]\nplace [coin] scene [104] xy [-157] [-129]\nplace [coin] scene [101] xy [170] [-124]\nplace [coin] scene [102] xy [-194] [-130]\nplace [Key 1] scene [8] xy [110] [14]\nplace [coin] scene [6] xy [210] [-85]\nplace [coin] scene [103] xy [18] [-122]\nplace [coin] scene [7] xy [0] [-90]\nplace [Checkpoint] scene [5] xy [-7] [50]\nplace [Checkpoint] scene [10] xy [-20] [0]\nplace [coin] scene [14] xy [-188] [74]\nplace [coin] scene [15] xy [-20] [-85]\nplace [coin] scene [11] xy [156] [-111]\nplace [coin] scene [12] xy [-144] [109]\nplace [coin] scene [13] xy [170] [108]\n\ndefine place (costume name) scene (scene) xy (x) (y)\nset [my scene v] to (scene)\nswitch costume to (costume name)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [my scene v] to []\n\nwhen flag clicked\nhide variable [coins v]\n\nwhen backdrop switches to [main backroung v]\nshow variable [coins v]\n\nwhen [h v] key pressed\nshow list [collected v]\nhide variable [coins v]\nhide variable [lives v]\n\nwhen flag clicked\nshow list [collected v]\n\nwhen I receive [reset game v]\ndelete this clone\n\nwhen I receive [main menu v]\ndelete all of [collected v]\nset [frame v] to [0]\nset [coins v] to [0]\nset [lives v] to [5]\nhide\nplace [coin] scene [104] xy [-157] [30]\nplace [coin] scene [104] xy [-157] [-129]\nplace [coin] scene [101] xy [170] [-124]\nplace [coin] scene [102] xy [-194] [-130]\nplace [Key 1] scene [8] xy [110] [14]\nplace [coin] scene [6] xy [210] [-85]\nplace [coin] scene [103] xy [18] [-122]\nplace [coin] scene [7] xy [0] [-90]\nplace [Checkpoint] scene [5] xy [-7] [50]\nplace [Checkpoint] scene [10] xy [-20] [0]\nplace [coin] scene [14] xy [-188] [74]\nplace [coin] scene [112] xy [0] [0]\nplace [coin] scene [113] xy [-15] [19]\nplace [coin] scene [15] xy [-20] [-85]\n\n@Platforms\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [4]> then\n    show\n    Animate Platform\nend\nif <(SCENE #) = [5]> then\n    show\n    Animate 2\nend\nif <(SCENE #) = [102]> then\n    show\n    Animate 3\nend\nif <(SCENE #) = [104]> then\n    show\n    Animate 4\nend\nif <(SCENE #) = [10]> then\n    show\n    Animate 5\nend\nif <(SCENE #) = [14]> then\n    show\n    Animate 6\nend\nif <(SCENE #) = [15]> then\n    show\n    Door at [223] [-1] key [Key 1]\nend\nif <(SCENE #) = [16]> then\n    switch backdrop to (game end v)\nend\n\ndefine Animate Platform\nswitch costume to (platform 1 v)\ngo to x: (102) y: (28)\nforever\n    glide (3) secs to x: (-18) y: (28)\n    wait (1) seconds\n    glide (3) secs to x: (102) y: (28)\n    wait (1) 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 (new x) (new y)\nif <(new y) > (last y)> then\n    change y by (1)\nelse\n    set y to ((last y) + (1))\nend\nif <touching (player v)?> then\n    set [platform dx v] to ((new x) - (last x))\n    set [platform dy v] to ((new y) - (last y))\nend\ngo to x: (new x) y: (new y)\n\ndefine Animate 2\nswitch costume to (platform 2 v)\ngo to x: (10) y: (-38)\nforever\n    glide (2.5) secs to x: (-95) y: (-38)\n    wait (1) seconds\n    glide (2.5) secs to x: (10) y: (-38)\n    wait (1) seconds\nend\n\ndefine Animate 3\nswitch costume to (platform 3 v)\ngo to x: (-11) y: (-38)\nforever\n    glide (2.5) secs to x: (-11) y: (108)\n    wait (1) seconds\n    glide (2.5) secs to x: (-11) y: (-38)\n    wait (1) seconds\nend\n\ndefine Animate 4\nswitch costume to (platform 4 v)\ngo to x: (-11) y: (52)\nforever\n    glide (2.5) secs to x: (-11) y: (115)\n    wait (1) seconds\n    glide (2.5) secs to x: (-11) y: (52)\n    wait (1) seconds\nend\n\ndefine Door at (x) (y) key (key name)\nshow\nswitch costume to (key name)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        start sound [Buzz Whir v]\n        repeat (28)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Low Squeak v]\n        repeat (28)\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 variable [lives v]\n\ndefine Animate 5\nswitch costume to (platform 5 v)\ngo to x: (-12) y: (-43)\nforever\n    glide (1.5) secs to x: (-12) y: (-25)\n    wait (1) seconds\n    glide (1.5) secs to x: (-12) y: (-43)\n    wait (1) seconds\nend\n\ndefine Animate 6\nswitch costume to (platform 6 v)\ngo to x: (-17) y: (-204)\nforever\n    glide (3) secs to x: (-17) y: (-26)\n    wait (1) seconds\n    glide (3) secs to x: (-17) y: (-204)\n    wait (1) seconds\nend\n\ndefine Animate 7\nswitch costume to (platform 7 v)\ngo to x: (103) y: (-119)\nforever\n    glide (3) secs to x: (103) y: (1)\n    wait (1) seconds\n    glide (3) secs to x: (103) y: (-119)\n    wait (1) seconds\nend\n\nwhen I receive [start game v]\nhide variable [lives v]\n\n@Splash Screen\n\nwhen flag clicked\ngo to x: (0) y: (40)\nglide (2) secs to x: (0) y: (40)\nswitch costume to (main menu v)\ngo to [front v] layer\nshow\n\nwhen I receive [game over v]\ngo to x: (0) y: (40)\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@Sprite4\n\nwhen I receive [main menu v]\nglide (2) secs to x: (-8) y: (-15)\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\ngo to x: (-8) y: (-15)\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 flag clicked\nhide\n\nwhen this sprite clicked\nhide\nbroadcast (Start Game v)\n\nwhen I receive [start game v]\nshow variable [lives v]\nshow variable [coins v]\n\nwhen flag clicked\nhide variable [acceleration v]\n\nwhen I receive [start game v]\nhide\n\n@Platforms2\n\nwhen I receive [change scene v]\ngo to [back v] layer\nhide\nif <(SCENE #) = [15]> then\n    show\n    Animate 7\nend\n\ndefine Animate Platform\nswitch costume to (platform 1 v)\ngo to x: (102) y: (28)\nforever\n    glide (3) secs to x: (-18) y: (28)\n    wait (1) seconds\n    glide (3) secs to x: (102) y: (28)\n    wait (1) 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 (new x) (new y)\nif <(new y) > (last y)> then\n    change y by (1)\nelse\n    set y to ((last y) + (1))\nend\nif <touching (player v)?> then\n    set [platform dx v] to ((new x) - (last x))\n    set [platform dy v] to ((new y) - (last y))\nend\ngo to x: (new x) y: (new y)\n\ndefine Animate 2\nswitch costume to (platform 2 v)\ngo to x: (10) y: (-38)\nforever\n    glide (2.5) secs to x: (-95) y: (-38)\n    wait (1) seconds\n    glide (2.5) secs to x: (10) y: (-38)\n    wait (1) seconds\nend\n\ndefine Animate 3\nswitch costume to (platform 3 v)\ngo to x: (-11) y: (-38)\nforever\n    glide (2.5) secs to x: (-11) y: (108)\n    wait (1) seconds\n    glide (2.5) secs to x: (-11) y: (-38)\n    wait (1) seconds\nend\n\ndefine Animate 4\nswitch costume to (platform 4 v)\ngo to x: (-11) y: (52)\nforever\n    glide (2.5) secs to x: (-11) y: (115)\n    wait (1) seconds\n    glide (2.5) secs to x: (-11) y: (52)\n    wait (1) seconds\nend\n\ndefine Door at (x) (y) key (key name)\nshow\nswitch costume to (key name)\ngo to x: (x) y: (y)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        start sound [Buzz Whir v]\n        repeat (24)\n            change y by (4)\n        end\n        wait (1) seconds\n        start sound [Low Squeak v]\n        repeat (24)\n            change y by (-4)\n        end\n        start sound [Crunch v]\n    else\n        start sound [Low Squeak v]\n    end\n    wait until <not <touching (player v)?>>\nend\n\nwhen flag clicked\nhide variable [lives v]\nforever\n    hide variable [lives v]\n    hide variable [coins v]\nend\n\nwhen backdrop switches to [main backroung v]\nshow variable [lives v]\n\ndefine Animate 5\nswitch costume to (platform 5 v)\ngo to x: (-12) y: (-43)\nforever\n    glide (1.5) secs to x: (-12) y: (-25)\n    wait (1) seconds\n    glide (1.5) secs to x: (-12) y: (-43)\n    wait (1) seconds\nend\n\ndefine Animate 6\nswitch costume to (platform 6 v)\ngo to x: (-17) y: (-204)\nforever\n    glide (3) secs to x: (-17) y: (-26)\n    wait (1) seconds\n    glide (3) secs to x: (-17) y: (-204)\n    wait (1) seconds\nend\n\ndefine Animate 7\nswitch costume to (platform 7 v)\ngo to x: (103) y: (-119)\nforever\n    glide (3) secs to x: (103) y: (1)\n    wait (1) seconds\n    glide (3) secs to x: (103) y: (-119)\n    wait (1) seconds\nend\n\n@LIVES\n\nwhen flag clicked\nhide\nif <(SCENE #) = [18]> then\n    forever\n        hide\n    end\nend\n\nwhen I receive [start game v]\nswitch costume to (lives 5 v)\nshow\n\nwhen backdrop switches to [main backroung v]\nswitch costume to ((costume [number v]) + (1))\n\nwhen I receive [loose life v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen backdrop switches to [no lives v]\nforever\n    hide\nend\n\n@Coins\n\nwhen flag clicked\nhide\nif <(SCENE #) = [18]> then\n    forever\n        hide\n    end\nend\n\nwhen I receive [start game v]\nswitch costume to (coins 0 v)\nshow\n\nwhen backdrop switches to [coin backround v]\nswitch costume to ((costume [number v]) + (1))\n\n@Sprite6\n\nwhen flag clicked\nhide\nglide (2) secs to x: (-8) y: (-120)\nwait (0.1) seconds\ngo to [front v] layer\nshow\nset size to (10) %\ngo to x: (-8) y: (-120)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen this sprite clicked\nhide\nbroadcast (Start Game v)\nswitch backdrop to (no lives v)\nforever\n    set [lives v] to ((10000000) * (1000000))\nend\n\nwhen I receive [start game v]\nshow variable [lives v]\nshow variable [coins v]\n\nwhen flag clicked\nhide variable [acceleration v]\n\nwhen I receive [start game v]\nhide\n\n