Scratch Platformer e1
@Stage\n\n@Player\n\nwhen flag clicked\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [acceleration v] to [2]\nset [resistance v] to [0.8]\nset [speed y v] to [0]\ngo to x: (-150) y: (55)\nforever\n    if <key (up arrow v) pressed?> then\n        if <(falling) < [3]> then\n            set [speed y v] to (JUMP FORCE)\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        change [speed x v] by ((0) - (ACCELERATION))\n    end\n    if <key (right arrow v) pressed?> then\n        change [speed x v] by (ACCELERATION)\n    end\n    set [speed x v] to ((speed x) * (RESISTANCE))\n    change [speed y v] by (GRAVITY)\n    Move - in steps (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nend\n\nstop [all v]\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    if <touching color (#9966ff)?> 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    if <touching color (#9966ff)?> 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\n