Scratch Cat: A Platformer v2.0
@Stage\n\nwhen [l v] key pressed\nask [Which level do you want to go to?? \(Integers\)\(Beware of getting stuck\)] and wait\nset [scene # v] to (answer)\nbroadcast (Change scene v)\nreset And begin level\n\ndefine reset And begin level\nset [scene # v] to (answer)\nset [stage: speed y v] to [0]\nset [stage: speed x v] to [0]\nset [stage: falling v] to [99]\ngo to x: (-118) y: (250)\nbroadcast (Change scene v)\nbroadcast (game loop v)\n\n@Player\n\nwhen flag clicked\nset [gravity v] to [-1.5]\nset [jump force v] to [13]\nset [acceleration v] to [2]\nset [resistance v] to [0.8]\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 y) ) + ([abs v] of (SPEED X) ))\n\ndefine controls-up and down\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <(falling) < [3]> then\n        set [speed y v] to [13]\n    end\nend\nchange [speed y v] by (GRAVITY)\n\ndefine controls-left and right\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [speed x v] by ((0) - (acceleration))\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [speed x v] by (acceleration)\nend\nset [speed x v] to ((SPEED X) * (RESISTANCE))\n\ndefine reset and begin level\nset [scene # v] to [1]\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [falling v] to [99]\ngo to x: (-118) y: (60)\nbroadcast (Change scene v)\nbroadcast (game loop v)\n\nwhen I receive [game loop v]\nforever\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: [-235]\nend\nif <(x position) < [-235]> then\n    begin scene # ((SCENE #) + (-1)) go to x: [235]\nend\n\ndefine begin scene # (scene #) go to x: (x)\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 (640)\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\n@Poop On Me\n\nwhen flag clicked\nhide\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n\ndefine stamp outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen flag clicked\n\ndefine stamp shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (85)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\nerase all\nstamp outline\nstamp shadow\n\n@Sprite1\n\nwhen flag clicked\nforever\n    if <(SCENE #) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n
Second Version!!!\nNow with 26 levels (including secret levels)\nCan you find them all?!?\nArrow keys or WASD\nAnother version: https://scratch.mit.edu/projects/626425344/