Spring - A scrolling Platformer #scrolling platformers

Instructions: ★ Spring -  a scrolling platformer ★\nOne of my first ever scrolling platformers.\n\n★ Instructions ★\n\n> Use the arrow or WASD keys to move around\n> Avoid spikes, water and falling into the void\n> See what score you can get!\n\nThis game is very short, it's meant to be like that.\nRather, the purpose of it is to try to get to the end in the fastest time possible!\n\n\n\n\nI might add mobile support =)\n----------------------------------------------------------------------\n\nIf you enjoyed, please leave a heart and star (or a follow) - if in normal mode you get <32 seconds then you get a follow, if in speedrun mode you get <60 seconds, you get a follow and 1 love and heart.\n\n----------------------------------------------------------------------\n\nThis is a one level game but the whole purpose is for speedrunning and getting the quickest time - so have fun!\n\n\n\n\n

@Stage\n\nwhen flag clicked\nforever\n    play sound [bensound-memories v] until done\nend\n\nwhen [space v] key pressed\nset [position v] to (join (join [Position X:] ((SCROLL X) + (mouse x))) (join [.  Position Y:] ((SCROLL Y) + (mouse y))))\n\nwhen flag clicked\n\nif <(username) = [hamzai20]> then\n    show variable [position v]\nelse\n    hide variable [position v]\nend\n\nwhen I receive [end v]\nset [☁ scores v] to (timer)\n\n@Player\n\nwhen [s v] key pressed\nif <(ST) = [0]> then\n    forever\n        change [scroll x v] by (1)\n        set [mode v] to [speedrun]\n        X [8]\n    end\nelse\n    set [mode v] to [play]\nend\n\nwhen flag clicked\nset [mode v] to [play]\nset [st v] to [0]\nwait (1) seconds\nset [st v] to [1]\n\nwhen flag clicked\nbroadcast (Play game v)\n\ndefine Restart\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [air time v] to [0]\nset [game state v] to [playing]\nset [y velocity v] to [0]\ngo to x: (0) y: (0)\n\nwhen I receive [play game v]\nset [level v] to [1]\nRestart\nforever\n    repeat until <not <(GAME STATE) = [playing]>>\n        Update\n        Position\n    end\n    if <(GAME STATE) = [die]> then\n        Death\n    else\n        if <(GAME STATE) = [next level]> then\n            Next level\n        end\n        if <<<touching color (#ff7070)?> or <touching color (#ff9999)?>> or <touching color (#ffffff)?>> then\n            Next level\n        end\n    end\nend\n\ndefine Update\nswitch costume to (player_0 v)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    X [-8]\n    switch costume to (player_left v)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    X [8]\n    switch costume to (player_2 v)\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <(Air time) < [4]> then\n        set [y velocity v] to [17]\n        switch costume to (player_3 v)\n        go to (random position v)\n    end\nend\nchange [y velocity v] by (-2)\nY (Y velocity)\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (4)))\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (4)))\nif <(y) < [-180]> then\n    set [game state v] to [die]\nend\nif <<touching (enemies v)?> or <touching (saws v)?>> then\n    set [game state v] to [die]\nend\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <<touching (bouncy v)?> or <touching (bounce orb v)?>> then\n    set [y velocity v] to [23]\n    start sound [Mario_Jump_-_Gaming_Sound_Effect v]\nend\nif <(SCROLL X) > [6994]> then\n    wait (1) seconds\n    broadcast (end v)\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Y (y velocity)\nchange [air time v] by (1)\nchange [y v] by (y velocity)\nPosition\nrepeat until <not <touching (ground v)?>>\n    if <(y velocity) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [air time v] to [0]\n    end\n    Position\n    set [y velocity v] to [0]\nend\n\ndefine X (x velocity)\nchange [x v] by (x velocity)\nPosition\nif <touching (ground v)?> then\n    repeat (8)\n        change [y v] by (1)\n        Position\n        if <not <touching (ground v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-8)\n    repeat until <not <touching (ground v)?>>\n        if <(x velocity) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Death\nstop [other scripts in sprite v]\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nbroadcast (Play game v)\n\ndefine Next level\ngo to [front v] layer\nset rotation style [all around v]\nrepeat (50)\n    point towards (portal v)\n    turn right (50) degrees\n    move ((distance to [portal v]) / (4)) steps\nend\nwait (1) seconds\nchange [level v] by (1)\nRestart\nset [game state v] to [playing]\n\nwhen [0 v] key pressed\nif <(username) = [hamzai20]> then\n    if <(EDITOR) < [1]> then\n        set [editor v] to [1]\n        handle - God Mode\n    else\n        set [editor v] to [0]\n    end\nend\n\ndefine handle - God Mode\nstop [other scripts in sprite v]\nX (SCROLL X)\nif <key (left arrow v) pressed?> then\n    X [-8]\n    switch costume to (player_left v)\nend\nif <key (right arrow v) pressed?> then\n    X [8]\n    switch costume to (player_2 v)\nend\nchange [x v] by ((6) * (0.8))\nchange [y v] by ((6) * (0.8))\nset [x v] to ((0.7) * (x))\nset [y v] to ((0.7) * (y))\nchange [scroll x v] by (x)\nchange [scroll y v] by (y)\n\n@Ground\n\nwhen I start as a clone\nshow\nforever\n    Position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nend\n\nwhen flag clicked\nrepeat (1)\n    delete this clone\nend\nswitch costume to (level 1 - 1 v)\nPart [0] [0]\nPart [480] [0]\nPart [960] [0]\nPart [1440] [0]\nPart [2100] [0]\nPart [2900] [0]\nPart [3260] [55]\nPart [3900] [-120]\nPart [4245] [-110]\nPart [4980] [-150]\nPart [5225] [-99]\nPart [6000] [-91]\nPart [6410] [83]\nPart [7070] [160]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Part (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\n@Enemies\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nshow\nforever\n    Position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nend\n\nwhen flag clicked\nrepeat (1)\n    delete this clone\nend\nswitch costume to (level 1 - 1 v)\nPart [480] [0]\nPart [1550] [-60]\nPart [2100] [15]\nPart [2249] [-66]\nPart [3369] [-120]\nPart [3551] [-67]\nPart [4870] [-148]\n\ndefine Part (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\n@Decor\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nshow\nforever\n    Position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nend\n\nwhen flag clicked\nset [x v] to [0]\nset [y v] to [0]\nhide\nswitch costume to (level 1 - 1 v)\ncreate clone of (_myself_ v)\nset [x v] to [480]\nset [y v] to [0]\nswitch costume to (level 1 - 2 v)\ncreate clone of (_myself_ v)\nchange [x v] by (480)\nset [y v] to [0]\nswitch costume to (level 1 - 3 v)\ncreate clone of (_myself_ v)\nchange [x v] by (480)\nset [y v] to [0]\nswitch costume to (level 1 - 4 v)\ncreate clone of (_myself_ v)\nchange [x v] by (570)\nset [y v] to [0]\nswitch costume to (level 1 - 5 v)\ncreate clone of (_myself_ v)\nchange [x v] by (750)\nset [y v] to [35]\nswitch costume to (level 1 - 6 v)\ncreate clone of (_myself_ v)\n\n@Bouncy\n\nwhen I start as a clone\nshow\nforever\n    Position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nend\n\nwhen flag clicked\nrepeat (1)\n    delete this clone\nend\nswitch costume to (level 1 - 4 v)\nPart [2825] [83]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Part (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\n@Themed TilesBouncy2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to x: ((mouse x) * (0.02)) y: ((mouse y) * (0.02))\nend\n\ngo to x: (0) y: (0)\n\n@Bounce Orb\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nforever\n    Position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n    if <touching (player v)?> then\n        delete this clone\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Part (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen I receive [play game v]\nrepeat (1)\n    delete this clone\nend\nswitch costume to (level 1 - 1 v)\nPart [1824] [31]\n\nwhen I receive [play game v]\nrepeat (1)\n    delete this clone\nend\nswitch costume to (level 1 - 1 v)\nPart [1824] [31]\nPart [2707] [37]\nPart [3382] [-9]\nPart [4687] [-53]\nPart [4786] [-53]\nPart [4917] [-53]\n\n@Saws\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nset rotation style [all around v]\nshow\nforever\n    Position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n    turn right (10) degrees\nend\n\nwhen flag clicked\nhide\nrepeat (1)\n    delete this clone\nend\nswitch costume to (level 1 - 5 v)\nPart [214] [-70]\nPart [840] [-45]\nPart [1374] [-80]\nPart [2435] [-25]\nPart [3107] [-25]\n\nPart [3568] [-67]\n\ndefine Part (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\n@Blossom\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nclear graphic effects\ngo to [front v] layer\nset size to (pick random (90) to (250)) %\ngo to x: (pick random (-240) to (240)) y: (180)\nset [my wariable v] to (pick random (1) to (10000))\nrepeat (400)\n    change y by (([abs v] of ([cos v] of (my wariable) ) ) * (-2))\n    change [ghost v] effect by (0.25)\n    point in direction ((90) + (([sin v] of ((my wariable) * (0.1)) ) * (90)))\n    change x by ([sin v] of (my wariable) )\n    change [my wariable v] by ((size) / (65))\nend\ndelete this clone\n\nwhen I receive [game start v]\n\nhide\n\nwhen flag clicked\nshow\nset size to (0) %\nset [ghost v] effect to (99)\nforever\n    show\nend\n\nwhen flag clicked\nforever\n    wait (pick random (0.5) to (2)) seconds\n    create clone of (_myself_ v)\nend\n\n@More Decor\n\nwhen I start as a clone\nshow\nforever\n    Position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nend\n\nwhen flag clicked\nrepeat (1)\n    delete this clone\nend\nswitch costume to (level 1 - 7 v)\nPart [3191] [-16]\nPart [3607] [-71]\nPart [3862] [-17]\nPart [5380] [-44]\nPart [5970] [17]\nPart [7053] [278]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Part (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\n@timer\n\nwhen flag clicked\nhide\n\ndefine gen clones\nrepeat (10)\n    change [-idclone v] by (1)\n    create clone of (_myself_ v)\nend\nset [-idclone v] to [man]\n\nwhen I receive [game start v]\n\nwhen I start as a clone\nset size to (50) %\ngo to [front v] layer\nshow\nclear graphic effects\nset y to (-157)\npoint in direction (90)\nforever\n    if <not <(-idClone) = [man]>> then\n        if <((length of (timer)) + (1)) > (-idClone)> then\n            show\n            switch costume to (letter (-idClone) of (timer))\n            set x to (((-240) + ((-idClone) * (20))) - (<<< (timer) contains [.]?> and <(-idClone) > (length of ([floor v] of (timer) ))>> and <not <(letter (-idClone) of (timer)) = [.]>>> * (8)))\n            set y to ((145) + (((size) / (4)) - (12.5)))\n            if << (timer) contains [.]?> and <(-idClone) > (length of ([floor v] of (timer) ))>> then\n                set size to (40) %\n                change x by (((-idClone) - ((length of ([floor v] of (timer) )) + (1))) * (-3))\n            else\n                set size to (50) %\n            end\n        else\n            hide\n        end\n    end\n    go to [front v] layer\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\ngo to [front v] layer\ngo [backward v] ((length of (timer)) + (5)) layers\nset x to (((length of ([floor v] of (timer) )) + (1)) * (30))\n\nwhen flag clicked\nset [-idclone v] to [0]\nset [time v] to [0]\nhide variable [time v]\ngen clones\n\nshow\nset size to (65) %\nforever\n    go to [front v] layer\n    go [backward v] ((length of (timer)) + (1)) layers\n    set x to ((-240) + (((length of ([floor v] of (timer) )) + (1)) * (30)))\nend\n\nwhen flag clicked\nswitch costume to (---- v)\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nset [time v] to [0]\nshow variable [time v]\n\nwhen flag clicked\nforever\n    change [time v] by (0.1)\n    wait (0.05) seconds\nend\n\n@Sprite1\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\nwhen I receive [end v]\ngo to [front v] layer\ngo to [front v] layer\nrepeat (33)\n    change [ghost v] effect by (-3)\nend\n\nwhen I receive [end v]\nbroadcast (End Credits v)\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [end credits v]\nshow\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\ngo to x: (0) y: (0)\n\n@TB\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n