Erased - A Platformer

Instructions: In Erased, you have to jump from block to block to reach the goal. When you jump on a block, it gets erased. You must erase all blocks to open the goal.\n\nWalkthrough: https://www.youtube.com/watch?v=d0tdBkSxgl4&feature=youtu.be\n\nAll Coding By Me.\nLevel Design and Inspiration from Detiled.\n\nMusic Coming Soon.

@Stage\n\nwhen flag clicked\nset [color v] to [0]\nforever\n    change [color v] by (0.1)\n    set [color v] effect to (Color)\nend\n\n@player\n\nwhen flag clicked\nforever\n    set [color v] effect to (Color)\n    go to [front v] layer\nend\n\nwhen flag clicked\ngo to x: (-93) y: (0)\nset [yv v] to [0]\nset [can jump v] to [0]\nforever\n    set size to (85) %\n    if <key (left arrow v) pressed?> then\n        Move X [-5]\n    end\n    if <key (right arrow v) pressed?> then\n        Move X [5]\n    end\n    change [yv v] by (-1)\n    if <<key (up arrow v) pressed?> and <(Can Jump) = [1]>> then\n        set [yv v] to [12]\n    end\n    Move Y (yv)\n    if <(y position) < [-175]> then\n        broadcast (Reset v) and wait\n        set [yv v] to [0]\n        set [can jump v] to [0]\n        go to x: (-93) y: (0)\n    end\n    set size to (100) %\nend\n\ndefine Move X (num)\nchange x by (num)\nrepeat until <not <touching (level v)?>>\n    if <(num) < [0]> then\n        change x by (1)\n    else\n        change x by (-1)\n    end\nend\n\ndefine Move Y (num)\nset [can jump v] to [0]\nchange y by (num)\nrepeat until <not <touching (level v)?>>\n    set [yv v] to [0]\n    if <(num) < [0]> then\n        change y by (1)\n        set [can jump v] to [1]\n    else\n        change y by (-1)\n    end\nend\n\nwhen I receive [win v]\nset [yv v] to [0]\nset [can jump v] to [0]\ngo to x: (-93) y: (0)\n\n@level\n\nwhen flag clicked\nhide\nset [level v] to [1]\nMake Level (Level)\n\ndefine Place Block At (x) (y)\nchange [# of blocks v] by (1)\nswitch costume to (costume1 v)\ngo to x: ((x) * (32)) y: ((y) * (32))\ncreate clone of (_myself_ v)\n\ndefine Make Level (level)\nbroadcast (delete clones v)\nset [# of blocks v] to [0]\nif <(level) = [1]> then\n    Place Block At [-3] [-1]\n    Place Block At [-3] [-2]\n    Place Block At [-3] [-3]\n    Place Goal At [0] [-2]\nend\nif <(level) = [2]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-1]\n    Place Block At [-1] [-1]\n    Place Block At [0] [-1]\n    Place Block At [1] [-1]\n    Place Block At [2] [-1]\n    Place Goal At [5] [-1]\nend\nif <(level) = [3]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-1]\n    Place Block At [-1] [-1]\n    Place Block At [0] [-1]\n    Place Block At [1] [-1]\n    Place Block At [2] [-1]\n    Place Goal At [-5] [-1]\nend\nif <(level) = [4]> then\n    Place Block At [-3] [-1]\n    Place Block At [-1] [-1]\n    Place Block At [1] [-1]\n    Place Block At [3] [-1]\n    Place Block At [5] [-1]\n    Place Goal At [-3] [2]\nend\nif <(level) = [5]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-1]\n    Place Block At [-1] [-1]\n    Place Block At [0] [-1]\n    Place Block At [1] [-1]\n    Place Block At [-1] [1]\n    Place Goal At [-1] [4]\nend\nif <(level) = [6]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-1]\n    Place Block At [-1] [-1]\n    Place Block At [0] [-1]\n    Place Block At [1] [-1]\n    Place Block At [-3] [1]\n    Place Block At [1] [1]\n    Place Goal At [-1] [4]\nend\nif <(level) = [7]> then\n    Place Block At [-3] [-1]\n    Place Block At [-1] [0]\n    Place Block At [1] [-3]\n    Place Block At [3] [-1]\n    Place Goal At [-1] [3]\nend\nif <(level) = [8]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-1]\n    Place Block At [-1] [-1]\n    Place Block At [0] [-1]\n    Place Block At [1] [-1]\n    Place Block At [1] [0]\n    Place Block At [-2] [4]\n    Place Goal At [4] [1]\nend\nif <(level) = [9]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-1]\n    Place Block At [1] [1]\n    Place Block At [1] [-2]\n    Place Goal At [6] [1]\nend\nif <(level) = [10]> then\n    Place Block At [-3] [-1]\n    Place Block At [-3] [2]\n    Place Block At [-2] [-2]\n    Place Block At [1] [-1]\n    Place Goal At [-6] [-1]\nend\nif <(level) = [11]> then\n    Place Block At [-3] [-1]\n    Place Block At [-5] [-3]\n    Place Block At [-6] [-3]\n    Place Block At [-7] [-3]\n    Place Block At [-7] [-2]\n    Place Block At [-7] [-1]\n    Place Block At [-7] [0]\n    Place Block At [-7] [1]\n    Place Block At [-7] [2]\n    Place Block At [-7] [3]\n    Place Goal At [-3] [-2]\nend\nif <(level) = [12]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-1]\n    Place Block At [-1] [-1]\n    Place Block At [0] [-1]\n    Place Block At [1] [-1]\n    Place Block At [1] [0]\n    Place Block At [1] [1]\n    Place Goal At [1] [4]\nend\nif <(level) = [13]> then\n    Place Block At [-3] [-1]\n    Place Block At [-4] [-1]\n    Place Block At [-4] [0]\n    Place Block At [-6] [1]\n    Place Block At [-3] [2]\n    Place Goal At [0] [2]\nend\nif <(level) = [14]> then\n    Place Block At [-2] [-1]\n    Place Block At [-3] [-1]\n    Place Block At [-4] [-1]\n    Place Block At [-2] [-2]\n    Place Block At [-3] [-2]\n    Place Block At [-4] [-2]\n    Place Block At [-2] [-3]\n    Place Block At [-3] [-3]\n    Place Block At [-4] [-3]\n    Place Goal At [-3] [2]\nend\nif <(level) = [15]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-1]\n    Place Block At [-1] [-1]\n    Place Block At [0] [-1]\n    Place Block At [1] [-1]\n    Place Block At [-1] [-2]\n    Place Block At [-1] [0]\n    Place Block At [-1] [1]\n    Place Goal At [-1] [4]\nend\nif <(level) = [16]> then\n    Place Block At [-3] [-1]\n    Place Block At [-2] [-2]\n    Place Block At [-1] [-3]\n    Place Block At [-1] [0]\n    Place Block At [0] [-1]\n    Place Block At [1] [-2]\n    Place Goal At [-2] [3]\nend\nif <(level) > [16]> then\n    set [level v] to [1]\n    Make Level (Level)\nend\n\nwhen I receive [delete clones v]\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    set [color v] effect to (Color)\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nset size to (95) %\nwait until <touching (player v)?>\nswitch costume to (costume2 v)\nwait until <not <touching (player v)?>>\nchange [# of blocks v] by (-1)\ndelete this clone\n\nwhen I receive [reset v]\nMake Level (Level)\n\ndefine Place Goal At (x) (y)\nset [goal x v] to ((x) * (32))\nset [goal y v] to ((y) * (32))\ncreate clone of (goal v)\n\nwhen I receive [win v]\nchange [level v] by (1)\nMake Level (Level)\n\n@goal\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nforever\n    set [color v] effect to (Color)\nend\n\nwhen I start as a clone\ngo to x: (Goal X) y: (Goal Y)\nswitch costume to (costume3 v)\nwait until <(# of blocks) = [0]>\nswitch costume to (costume4 v)\nwait until <touching (player v)?>\nbroadcast (win v)\n\nwhen I receive [delete clones v]\ndelete this clone\n\n@bg\n\nwhen flag clicked\nhide\nrepeat (20)\n    wait (0.5) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\npoint in direction (pick random (0) to (360))\nset size to (pick random (50) to (150)) %\ngo to x: (pick random (-240) to (240)) y: (-180)\ngo to [back v] layer\nset [speed v] to (pick random (1.0) to (1.5))\nrepeat ((360) / (speed))\n    change y by (speed)\n    turn right ((speed) * (3)) degrees\nend\ncreate clone of (_myself_ v)\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    set [color v] effect to (Color)\nend\n\n@Sprite1\n\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\n\nwhen flag clicked\nhide\n\n