Sonic the Cube EXTENDED VERSION (A Platformer)

Instructions: |Sonic the Cube| EXTENDED VERSION\n*Instructions*\nUse the arrow keys to move (Or drag if you are on mobile.)\nAvoid obstacles!\nCollect rings! (And emeralds.)\nIf you collect 13 rings and 3 emeralds you'll transform into super sonic!! :D\nLike, Favorite, and Follow! (YES THIS IS PART OF THE INSTRUCTIONS GO LIKE, FAVORITE, AND FOLLOW!)\nThanks!

@Stage\n\nwhen flag clicked\nset volume to (50) %\nforever\n    play sound [Green Hill Zone \(LOOP\) - Sonic The Hedgehog2 v] until done\nend\n\n@Player\n\nwhen flag clicked\nset [gravity v] to [-1.5]\nset [jump force v] to [14]\nset [acceleration v] to [2.5]\nset [resistance v] to [0.8]\nbroadcast (Setup v) and wait\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        set x to (last value)\n        set [speed x v] to [0]\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)?> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick - player 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 <<mouse down?> and <(mouse y) > [0]>>> then\n    if <(falling) < [3]> then\n        set [speed y v] to (JUMP FORCE)\n    end\nend\nchange [speed y v] by (GRAVITY)\n\ndefine Controls - Left and Right\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    change [speed x v] by ((0) - (ACCELERATION))\n    point in direction (-90)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [speed x v] by (ACCELERATION)\n    point in direction (90)\nend\nset [speed x v] to ((speed x) * (RESISTANCE))\n\ndefine Reset and Begin Level\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling v] to [99]\npoint in direction (90)\nBegin Scene # [1] go to x, y: [-150] [55]\n\nwhen I receive [game loop v]\nset [pixelate v] effect to (0)\nset [ghost v] effect to (0)\nforever\n    broadcast (Tick - First 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 <<touching (danger2 v)?> or <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 #)\nset x to (x)\nbroadcast (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nFix Collision in Direction [0]\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 (150)\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]\nset rotation style [don't rotate v]\n\ndefine Set Costume\nset rotation style [left-right v]\n\nwhen I receive [lose life v]\nstop [other scripts in sprite v]\nplay sound [Crunch v] until done\nrepeat (10)\n    change [pixelate v] effect by (25)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\ngo to x: (-158) y: (62)\nrespawn\n\nwhen I receive [gotta go fast v]\nset [acceleration v] to [5.1]\nset [jump force v] to [20]\n\nwhen I receive [no more speed :\( v]\nset [acceleration v] to [2]\nset [jump force v] to [14]\n\nwhen flag clicked\ngo to x: (-158) y: (62)\n\nwhen I receive [hyper wave v]\nset [acceleration v] to [4]\nset [jump force v] to [21]\nforever\n    switch costume to (super player v)\nend\n\nplay sound [Supersonic v] until done\n\ndefine respawn\ngo to x: (-208) y: (-30)\npoint in direction (90)\nFix Collision in Direction [0]\nbroadcast (Game Loop v)\nshow\n\nwhen flag clicked\nswitch costume to (player 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 #))\n\n@Coin\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]> or <(costume [name v]) = [Gem]>> or <(costume [name v]) = [Gem2]>> or <(costume [name v]) = [Gem3]>> then\n    start sound [Coin v]\n    change [coins v] by (1)\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]\nhide\nPlace [Coin] scene [1] xy [-37] [-22]\nPlace [Coin] scene [1] xy [129] [-21]\nPlace [Coin] scene [2] xy [115] [-26]\nPlace [Coin] scene [2] xy [-11] [-27]\nPlace [Coin] scene [3] xy [34] [45]\nPlace [Coin] scene [4] xy [7] [64]\nPlace [Coin] scene [4] xy [-85] [11]\nPlace [Coin] scene [4] xy [95] [16]\nPlace [Coin] scene [5] xy [-88] [38]\nPlace [Coin] scene [5] xy [171] [-28]\nPlace [Coin] scene [6] xy [-41] [-27]\nPlace [Coin] scene [6] xy [90] [-27]\nPlace [Coin] scene [6] xy [209] [59]\nPlace [Gem] scene [7] xy [188] [-18]\nPlace [Gem2] scene [9] xy [188] [-18]\nPlace [Gem3] scene [11] xy [210] [144]\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\nforever\n    if <(COINS) = [16]> then\n        broadcast (Hyper Wave v)\n    end\nend\n\nif  then\nelse\n    broadcast (Default v)\nend\n\n@Danger\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nif <(costume [name v]) = [blank]> then\n    broadcast (Googoo v)\nend\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nif <(SCENE #) = [4]> then\n    go to x: (0) y: (3)\n    forever\n        point in direction (90)\n    end\nend\nif <(SCENE #) = [3]> then\n    go to x: (10) y: (1)\n    forever\n        point in direction (90)\n    end\nend\nif <(SCENE #) = [2]> then\n    broadcast (Googoo2 v)\n    go to x: (7) y: (1)\n    forever\n        point in direction (90)\n    end\nend\nif <(SCENE #) = [5]> then\n    go to x: (-1) y: (1)\n    forever\n        point in direction (90)\n    end\nend\nif <(SCENE #) = [6]> then\n    go to x: (0) y: (0)\n    forever\n        point in direction (90)\n    end\nend\nif <(SCENE #) = [8]> then\n    go to x: (21) y: (-2)\n    forever\n        point in direction (90)\n    end\nend\nif <(SCENE #) = [10]> then\n    go to x: (0) y: (0)\n    forever\n        point in direction (90)\n    end\nend\nif <(SCENE #) = [11]> then\n    go to x: (0) y: (0)\n    forever\n        point in direction (90)\n    end\nend\nif <(SCENE #) = [12]> then\n    go to x: (0) y: (0)\n    forever\n        point in direction (90)\n    end\nend\n\n@Hints\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nif <(SCENE #) = [4]> then\n    go to x: (-5) y: (16)\nend\nif <(SCENE #) = [5]> then\n    go to x: (-5) y: (16)\nend\nif <(SCENE #) = [9]> then\n    go to x: (-5) y: (16)\nend\nif <(SCENE #) = [10]> then\n    go to x: (-5) y: (16)\nend\nif <(SCENE #) = [11]> then\n    go to x: (-5) y: (16)\nend\nif <(SCENE #) = [12]> then\n    go to x: (-5) y: (16)\nend\nif <(SCENE #) = [13]> then\n    go to x: (-5) y: (16)\nend\n\n@TN\n\nwhen flag clicked\ngo to x: (0) y: (0)\nrepeat (10)\n    change [color v] effect by (25)\n    change [pixelate v] effect by (25)\n    change [ghost v] effect by (10)\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [gotta go fast v]\nswitch costume to (costume1 v)\nshow\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.001) seconds\nhide\n\n@Speed\n\nwhen flag clicked\nshow\nswitch costume to (speeeeeeeeeed v)\ngo to x: (172) y: (-144)\n\nwhen this sprite clicked\nbroadcast (GOTTA GO FAST v)\nstart sound [Wood Tap v]\nchange size by (-10)\nwait (0.0999) seconds\nchange size by (10)\nswitch costume to (no more speed :\( v)\nwait (5) seconds\nbroadcast (NO MORE SPEED :\( v)\nhide\nwait (10) seconds\nshow\nswitch costume to (speeeeeeeeeed v)\n\nwhen flag clicked\ngo to [front v] layer\n\n@flaghjhjdghjks\n\nwhen flag clicked\ngo to x: (-170) y: (-5)\npoint in direction (90)\n\nwhen I receive [googoo2 v]\ngo to x: (-203) y: (-4)\n\n@Sprite2\n\nwhen flag clicked\nwait (0.00000001) seconds\ngo to [front v] layer\nshow\n\nwhen [space v] key pressed\nrepeat (10)\n    change [ghost v] effect by (10)\n    change [pixelate v] effect by (25)\n    change [color v] effect by (25)\nend\nhide\n\n