No Control Blocks: Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nset [l v] to [1]\nbroadcast (loop v)\nbroadcast (loop2 v)\n\nwhen I receive [loop2 v]\nswitch backdrop to (l)\nbroadcast (loop2 v)\n\n@Sprite1\n\ndefine physics\nchange [xv v] by (<key (right arrow v) pressed?> * (2))\nchange [xv v] by (<key (left arrow v) pressed?> * (-2))\nset [xv v] to ((xv) * (0.7))\nchange x by (xv)\nset [a v] to <touching color (#000000)?>\nchange x by (() - ((a) * (xv)))\nchange [xv v] by (() - ((a) * (xv)))\nchange [yv v] by (-0.5)\nchange y by (yv)\nset [a v] to <touching color (#000000)?>\nchange y by (() - ((a) * (yv)))\nchange [yv v] by (() - ((a) * (yv)))\nchange y by (-1)\nchange [yv v] by (<<key (up arrow v) pressed?> and <touching color (#000000)?>> * ((10) - (yv)))\nchange y by (1)\nchange [l v] by <(x position) > [240]>\nset [a v] to <<(y position) < [-180]> or <<(x position) > [240]> or <touching color (#ff0000)?>>>\nchange [xv v] by (() - ((a) * (xv)))\nchange [yv v] by (() - ((a) * (yv)))\ngo to x: ((x position) - (((x position) + (130)) * (a))) y: ((y position) - ((y position) * (a)))\n\nwhen flag clicked\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-130) y: (0)\n\nwhen I receive [loop v]\nphysics\nbroadcast (loop v)\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n