GREEN CUBE (Platformer)

Instructions: Green Cube (Platformer)\nArrow keys to move.  Orange is bouncy.  Don't run into the spikes!\nAll levels are possible.\nEnjoy!

@Stage\n\n@Sprite1\n\nwhen flag clicked\nbroadcast (Setup v)\n\nwhen I receive [setup v]\nswitch costume to (costume1 v)\ngo to x: (-211) y: (-91)\nset [x v] to [0]\nset [y v] to [0]\n\nwhen I receive [play v]\nswitch backdrop to (backdrop1 v)\nforever\n    Move\nend\n\ndefine Move\nif <key (right arrow v) pressed?> then\n    change [x v] by (5)\n    switch costume to (costume1 v)\nend\nif <key (left arrow v) pressed?> then\n    change [x v] by (-5)\n    switch costume to (costume2 v)\nend\nset [x v] to ((x) * (.6))\nchange x by (x)\nif <<touching color (#347229)?> or <touching color (#805833)?>> then\n    change x by ((x) * (-1))\n    set [x v] to [0]\nend\nchange [y v] by (-2)\nchange y by (y)\nif <<touching color (#347229)?> or <touching color (#805833)?>> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-2)\nif <<<touching color (#347229)?> or <touching color (#805833)?>> and <key (up arrow v) pressed?>> then\n    set [y v] to [20]\nend\nchange y by (2)\nif <(x position) > [240]> then\n    next backdrop\n    go to x: (-211) y: (-91)\n    set [x v] to [0]\n    set [y v] to [0]\nend\nif <(y position) = [-178]> then\n    go to x: (-211) y: (-91)\n    set [x v] to [0]\n    set [y v] to [0]\nend\nif <touching color (#945400)?> then\n    set [y v] to [30]\nend\nif <touching color (#575757)?> then\n    go to x: (-211) y: (-91)\n    set [x v] to [0]\n    set [y v] to [0]\nend\nif <touching color (#119cb6)?> then\n    change [y v] by (3)\nend\nif <<touching color (#119cb6)?> and <key (down arrow v) pressed?>> then\n    change [y v] by (-2)\nend\n\nwhen [r v] key pressed\ngo to x: (-211) y: (-91)\nset [x v] to [0]\nset [y v] to [0]\n\nwhen [s v] key pressed\nnext backdrop\ngo to x: (-211) y: (-91)\nset [x v] to [0]\nset [y v] to [0]\n\n@Sprite3\n\nwhen backdrop switches to [backdrop1 v]\nshow\nset [ghost v] effect to (20)\nforever\n    go to x: (pick random (112) to (113)) y: (pick random (-87) to (-89))\nend\n\nwhen backdrop switches to [backdrop2 v]\nhide\n\nwhen backdrop switches to [backdrop3 v]\nshow\nset [ghost v] effect to (20)\nstop [other scripts in sprite v]\nforever\n    go to x: (pick random (44) to (45)) y: (pick random (107) to (106))\nend\n\nwhen backdrop switches to [backdrop4 v]\nhide\n\nwhen backdrop switches to [backdrop9 v]\nshow\nset [ghost v] effect to (20)\nstop [other scripts in sprite v]\nforever\n    go to x: (pick random (143) to (144)) y: (pick random (-79) to (-78))\nend\n\ngo to x: (44) y: (107)\n\nwhen backdrop switches to [backdrop8 v]\nhide\n\nwhen backdrop switches to [backdrop20 v]\nshow\nset [ghost v] effect to (20)\nstop [other scripts in sprite v]\nforever\n    go to x: (pick random (-111) to (-112)) y: (pick random (-95) to (-96))\nend\n\ngo to x: (143) y: (-79)\n\nwhen backdrop switches to [backdrop21 v]\nhide\n\n@Sprite2\n\nwhen backdrop switches to [backdrop21 v]\ngo to [front v] layer\nshow\nstop [all v]\n\nwhen I receive [setup v]\nhide\n\n@Sprite4\n\nwhen I receive [setup v]\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [play v]\nhide\n\n@Sprite5\n\nwhen this sprite clicked\nbroadcast (Play v)\nhide\n\nwhen I receive [setup v]\nshow\ngo to [front v] layer\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\n