Splash A Platformer || #games #all

Instructions: Here is PT 2 of my platformer game! = https://scratch.mit.edu/projects/645266047\nThe tutorial might not be finished, but I feel like I want to work on my other projects more! Anyway, here are the rules:\n\nUse the arrow keys to control the player, sadly this is not mobile and that you can’t use ‘WASD’. If you die, you have to start all over again:( And, um… I think that’s it ;)

@Stage\n\nwhen flag clicked\nforever\n    play sound [music v] until done\nend\n\n@Blank\n\n@Player\n\nwhen flag clicked\nset [gravity v] to [-1]\nset [spawn scene v] to [1]\nset [spawn x v] to [-150]\nset [spawn y v] to [55]\nbroadcast (Setup v)\nReset and begin Level\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        set y to (Last value)\n        if <(speed y) < [0]> then\n            set [falling v] to [0]\n        end\n        set [speed y v] to [0]\n    end\nend\n\ndefine Check touching solid\nif <<touching (level 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 x) ) + ([abs v] of (speed y) ))\n\ndefine Controls - Up and Down\nif <key (up arrow v) pressed?> then\n    if <(falling) < [3]> then\n        set [speed y v] to [12]\n    end\nend\nchange [speed y v] by (Gravity)\n\ndefine Controls - Left and Right\nif <key (left arrow v) pressed?> then\n    change [speed x v] by (-1.5)\n    point in direction (-90)\nend\nif <key (right arrow v) pressed?> then\n    change [speed x v] by (1.5)\n    point in direction (90)\nend\nset [speed x v] to ((speed x) * (0.8))\n\ndefine Reset and begin Level\nset [scene # v] to [1]\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling v] to [99]\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 - 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 (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nbroadcast (Game Loop v)\nif <(x) > []> then\n    Fix Collision in Direction []\nelse\n    Fix Collision in Direction [90]\nend\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 Collide X - Slope or Wall?\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))\n\nwhen I receive [lose life v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\nReset and begin Level\n\ndefine Moved - by Moving Platform\nCheck touching solid\nif <(touching) > [0]> then\n    Fix Collision in Direction [0]\nend\n\n@Level\n\nwhen flag clicked\nreset timer\ngo to x: (2) y: (6)\ngo to [back v] layer\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (Scene #))\n\nif <(Scene #) = [14]> then\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\nend\n\n@Love, Fav and Follow\n\nwhen flag clicked\nhide\ngo to [front v] layer\nforever\n    wait (pick random (10) to (15)) 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 (0)\n    end\n    repeat (5)\n        change y by (5)\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\nwhen flag clicked\nhide\ngo to x: (-6) y: (105)\n\n@Danger\n\nwhen flag clicked\ngo to x: (2) y: (6)\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 #) = [3]> or <<(Scene #) = [6]> or <(Scene #) = [7]>>> or <(Scene #) = [9]>> then\n    forever\n        set y to ((5) * ([sin v] of ((timer) * (360)) ))\n    end\nend\n\n@Platform\n\nwhen I receive [change scene v]\nhide\nif <(Scene #) = [7]> then\n    show\n    Animate Platform\nend\n\ndefine Animate Platform\ngo to x: (-105) y: (-65)\nforever\n    glide (2) secs to x: (128) y: (-63)\n    wait (1) seconds\n    glide (2) secs to x: (-105) y: (-65)\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))\nelse\nend\ngo to x: (new x) y: (new y)\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\nwait until <touching (player v)?>\nset [my scene v] to []\nstart sound [Connect v]\nhide\n\nwhen I receive [setup v]\nset [my scene v] to [1]\nshow\nswitch costume to (crystal v)\ngo to x: (44) y: (18)\ncreate clone of (_myself_ v)\ngo to x: (-201) y: (149)\ncreate clone of (_myself_ v)\nset [my scene v] to []\n\nset [my scene v] to [2]\nshow\nswitch costume to (crystal v)\ngo to x: (43) y: (37)\ncreate clone of (_myself_ v)\n\n