Summer || a platformer #games
@Stage\n\nwhen flag clicked\nswitch backdrop to (red v)\n\nwhen I receive [start v]\nswitch backdrop to (1 v)\n\nwhen I receive [@cheekyscuola's transition v]\nnext backdrop\n\n@Intro\n\nwhen I receive [menu v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen flag clicked\nswitch costume to (costume1 v)\nswitch backdrop to (red v)\nset [sine v] to [0]\nhide\nbroadcast (intro v)\nforever\n    change [sine v] by (1)\nend\n\nwhen I receive [shrink v]\nif <(costume [number v]) = [1]> then\n    start sound [grow v]\nend\nrepeat until <(size vel) < [0]>\n    turn left ((size vel) * (0.3)) degrees\n    change size by (size vel)\nend\nset [sine v] to [0]\nset [swoosh? v] to [y]\nif <(costume [number v]) = [1]> then\n    start sound [swoosh v]\n    repeat until <(x position) > [0]>\n        set x to (([tan v] of ((sine) * (8)) ) * (-20))\n        turn right (([tan v] of ((sine) * (8)) ) * (20)) degrees\n    end\n    repeat until <(x position) < [0]>\n        set x to (([tan v] of ((sine) * (8)) ) * (-20))\n        turn right (((90) - (direction)) / (3)) degrees\n    end\nelse\n    repeat until <(x position) < [0]>\n        set x to (([tan v] of ((sine) * (8)) ) * (20))\n        turn right (([tan v] of ((sine) * (8)) ) * (20)) degrees\n    end\n    repeat until <(x position) > [0]>\n        set x to (([tan v] of ((sine) * (8)) ) * (20))\n        turn right (((90) - (direction)) / (3)) degrees\n    end\nend\nbroadcast (showtext v)\nswitch costume to (costume2 v)\nbroadcast (startmusic v)\nwait (3) seconds\nstart sound [wop v]\nset [swoosh? v] to [n]\nrepeat until <(size) < [10]>\n    turn left ((size vel) * (0.3)) degrees\n    change size by (size vel)\nend\nhide\nbroadcast (Start v)\nswitch backdrop to (1 v)\n\nwhen I receive [intro v]\nstart sound [dweep v]\nset size to (0) %\nswitch costume to (1 v)\ngo to x: (0) y: (0)\npoint in direction (90)\nshow\nset [id v] to [start]\ngo to [front v] layer\ncreate clone of (_myself_ v)\ngo to [front v] layer\nrepeat (30)\n    set [y bounce v] to (((y bounce) * (0.7)) + (((50) - (size)) / (3)))\n    change size by (y bounce)\nend\nset size to (50) %\nset [sine v] to [0]\nstart sound [swoosh v]\nrepeat until <(y position) < [0]>\n    set y to (([tan v] of ((sine) * (8)) ) * (20))\n    set size to ([abs v] of (((180) - ([abs v] of (y position) )) / (3.5)) ) %\nend\nrepeat until <(y position) > [0]>\n    set y to (([tan v] of ((sine) * (8)) ) * (20))\n    set size to ([abs v] of (((180) - ([abs v] of (y position) )) / (3.5)) ) %\nend\nset y to (0)\nset [size vel v] to [20]\nbroadcast (shrink v)\nrepeat until <(size vel) < [0]>\n    change [size vel v] by (-2)\nend\nset [swoosh? v] to [y]\nwait until <(swoosh?) = [n]>\nbroadcast (hide v)\nforever\n    change [size vel v] by (-2)\nend\n\nwhen I start as a clone\nshow\nset size to (0) %\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\npoint in direction (90)\nrepeat (30)\n    set [y bounce v] to (((y bounce) * (0.7)) + (((50) - (size)) / (3)))\n    change size by (y bounce)\nend\nrepeat until <(y position) > [0]>\n    set y to (([tan v] of ((sine) * (8)) ) * (-20))\n    set size to ([abs v] of (((180) - ([abs v] of (y position) )) / (3.5)) ) %\nend\nrepeat until <(y position) < [0]>\n    set y to (([tan v] of ((sine) * (8)) ) * (-20))\n    set size to ([abs v] of (((180) - ([abs v] of (y position) )) / (3.5)) ) %\nend\nset y to (0)\n\n@Intro2\n\nwhen flag clicked\nshow\ngo to [back v] layer\ngo to x: (228) y: (-1)\nrepeat until <(Start game) = [1]>\n    change x by (-6)\nend\n\nwhen I receive [hide v]\nhide\n\n@Level\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen I receive [start v]\ngo to [front v] layer\nshow\n\nwhen I receive [@cheekyscuola's transition v]\nwait (0.5) seconds\nnext costume\n\nwhen flag clicked\n\n@Spikes\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [start v]\nshow\nswitch costume to (costume3 v)\ngo to [front v] layer\n\nwhen flag clicked\nhide\n\nwhen I receive [@cheekyscuola's transition v]\nnext costume\n\n@Trampoline\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Player\n\nwhen flag clicked\nset volume to (50) %\nset [level v] to [1]\nset [deaths v] to [0]\nhide\n\ndefine Platformer Physics (speed) (friction) (jump height)\nchange [y velocity v] by (-1)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [x velocity v] by (speed)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [x velocity v] by ((0) - (speed))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nset [slope v] to [0]\nif <touching (level v)?> then\n    repeat until <<not <touching (level v)?>> or <(Slope) = [-8]>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\nend\nif <touching (level v)?> then\n    change y by (Slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((0) - (([abs v] of (X Velocity) ) / (X Velocity)))\n    end\n    set [x velocity v] to [0]\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n    end\n    set [y velocity v] to [0]\nend\nchange y by (-1)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (level v)?>> then\n    set [y velocity v] to (jump height)\nend\nchange y by (1)\nif <touching (water v)?> then\n    set [y velocity v] to [-1]\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        set [y velocity v] to [5]\n    end\n    if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(y position) > (mouse y)>>> then\n        set [y velocity v] to [-5]\n    end\nend\n\ndefine Detection\nif <(x position) > [240]> then\n    broadcast (Create Clone v)\n    broadcast (@cheekyscuola's Transition v)\n    start sound [Ding Sound Effect v]\n    set [level v] to ((Level) + (1))\n    set [x velocity v] to [0]\n    set [y velocity v] to [0]\n    go to x: (-215) y: (-70)\nend\nif <<<<<<touching (spikes v)?> or <touching (lava v)?>> or <touching (saws v)?>> or <<<touching (upspikes v)?> or <touching (downspikes v)?>> or <touching (acid v)?>>> or <(y position) = [-179]>> and <not <(CHEAT) = [1]>>> then\n    start sound [Oops v]\n    set [deaths v] to ((DEATHS) + (1))\n    repeat (3)\n        hide\n        wait (0.11) seconds\n        show\n        wait (0.11) seconds\n    end\n    hide\n    wait (0.11) seconds\n    show\n    go to x: (-215) y: (-70)\n    set [x velocity v] to [0]\n    set [y velocity v] to [0]\nend\nif <touching (bouncy v)?> then\n    start sound [Big Boing v]\n    set [y velocity v] to [18]\nend\nif <touching (trampoline v)?> then\n    set [y velocity v] to [16]\nend\n\nwhen I receive [start v]\npoint in direction (90)\nset size to (100) %\nset [cheat v] to [0]\nwait (0.1) seconds\nshow\nswitch costume to (player v)\ngo [forward v] (88) layers\ngo to x: (-215) y: (-78)\nset rotation style [left-right v]\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platformer Physics [2] [0.79] [12.5]\n    Detection\nend\n\nwhen flag clicked\nforever\n    Cheats Menu\nend\n\ndefine Cheats Menu\nif <<<key (1 v) pressed?> and <<(username) = [250119code2]> or <(username) = [250119test2]>>> and <not <(CHEAT) = [1]>>> then\n    set [cheat v] to [1]\n    wait (0.3) seconds\nelse\n    if <<key (1 v) pressed?> and <(CHEAT) = [1]>> then\n        set [cheat v] to [0]\n        wait (0.3) seconds\n    end\nend\nif <<key (up arrow v) pressed?> and <(CHEAT) = [1]>> then\n    set [y velocity v] to [8]\nend\nif <<key (down arrow v) pressed?> and <(CHEAT) = [1]>> then\n    set [y velocity v] to [-6]\nend\n\nwhen flag clicked\nforever\n    set [x v] to (round (x position))\n    set [y v] to (round (y position))\nend\n\nwhen I receive [restart v]\nstart sound [Oops v]\nset [deaths v] to ((DEATHS) + (1))\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-215) y: (-70)\n\nbroadcast (Restart v)\n\nwhen I receive [jump v]\nset [y velocity v] to [8]\n\nwhen I receive [transition v]\ngo to x: (-215) y: (-70)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\n\nwhen flag clicked\nwait until <(Level) = [6]>\nbroadcast (Create Clone v)\n\nwhen I receive [@cheekyscuola's transition v]\ngo to x: (-215) y: (-70)\n\nwhen [s v] key pressed\nbroadcast (@cheekyscuola's Transition v)\nchange [level v] by (1)\n\n@Lava\n\nwhen I start as a clone\ngo [backward v] (200000) layers\nforever\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    switch costume to (Level)\n    set y to (([sin v] of ((timer) * (100)) ) * (10))\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    switch costume to (Level)\nend\n\n@Clouds\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset [side v] to (pick random (1) to (2))\nshow\nset [ghost v] effect to (pick random (20) to (25))\ngo to [back v] layer\nswitch costume to (pick random (1) to (2))\nif <(side) = [1]> then\n    go to x: (300) y: (pick random (150) to (100))\n    repeat until <(x position) < [-260]>\n        change x by (5)\n    end\n    delete this clone\nend\nif <(side) = [2]> then\n    go to x: (-300) y: (pick random (150) to (100))\n    repeat until <(x position) > [260]>\n        change x by (5)\n    end\n    delete this clone\nend\n\nwhen I receive [start v]\nrepeat until <(Level) = [11]>\n    create clone of (_myself_ v)\n    wait (pick random (10) to (25)) seconds\nend\n\n@Trees\n\nwhen flag clicked\ngo to [back v] layer\nhide\nforever\n    go to [back v] layer\n    switch costume to (Level)\nend\n\nwhen I receive [start v]\nshow\n\n@Music\n\nwhen this sprite clicked\nif <(costume [number v]) = [1]> then\n    wait (0.1) seconds\n    switch costume to (off v)\n    set volume to (0) %\nend\n\nwhen flag clicked\nswitch costume to (on v)\nhide\n\nwhen I receive [start v]\nset volume to (100) %\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    show\nend\n\nwhen I receive [start v]\nforever\n    play sound [Elektronomia- Summersong v] until done\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [2]> then\n    wait (0.1) seconds\n    switch costume to (on v)\n    set volume to (100) %\nend\n\n@Text\n\nwhen flag clicked\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [showtext v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nshow\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    show\nend\n\n
New game!\nThis platformer took me a while to make, enjoy!\n\nControls:\n-Arrow keys to move\n-Avoid spikes and lava\n-S to skip a level\n-Press the music button to turn music on/off\nIf you enjoyed, don't forget to ❤️, ⭐, and follow @MXNHD! 