Scrolling Platformer

Instructions: When you press the green flag, wait a little for the game to load.\nUse arrow keys to move. Press the up arrow longer to jump higher!\nBEWARE! One death puts you back to the beginning! \nNo checkpoints.

@Stage\n\n@Player\n\nwhen I receive [play v]\nshow\nforever\n    Griffpatch Platforming Engine [5]\nend\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <touching (level hitbox v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching (level hitbox v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\nend\nchange [frame v] by (0.5)\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (stand_1 v)\n    else\n        switch costume to ([floor v] of ((4) + ((frame) mod (8))) )\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (jump_1 v)\n    else\n        switch costume to (fall_1 v)\n    end\nend\n\ndefine Griffpatch Platforming Engine (speed)\nswitch costume to (hitbox v)\nif <<(speed y) < [4]> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange y by (speed y)\nTouch Ground <(speed y) > [0]>\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    Walk (-90) ((speed) * (-1))\nelse\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        Walk (90) (speed)\n    else\n        set [frame v] to [0]\n    end\nend\nif <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        start sound [jump v]\n        set [speed y v] to [14]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <(y position) < [-180]> then\n    start sound [fall v]\n    go to x: (0) y: (0)\n    point in direction (90)\n    set [scrollx v] to [0]\n    set [speed y v] to [0]\nend\nSet Costume\nScrolling Blocks\n\ndefine Reset Player\nshow\nset size to (40) %\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (0) y: (100)\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [scrollx v] to [0]\nhide\n\ndefine Scrolling Blocks\nchange [scrollx v] by (x position)\nset x to (0)\n\nwhen flag clicked\nhide\nbroadcast (Transition In v) and wait\nbroadcast (Delete All Clones v) and wait\nbroadcast (SetUp v) and wait\nbroadcast (Level Loop v)\nbroadcast (Play v)\nbroadcast (Transition Out v) and wait\n\nwhen I receive [setup v]\nReset Player\n\ndefine Quick Scroll\nif <key (right arrow v) pressed?> then\n    change [scrollx v] by (100)\nend\nif <key (left arrow v) pressed?> then\n    change [scrollx v] by (-100)\nend\n\n@Level HITBOX\n\ndefine Create\nwait (1) seconds\nrepeat ((Level Costumes) - (1))\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\n    next costume\nend\n\nwhen I receive [level loop v]\nforever\n    set x to ((Level_X) - (ScrollX))\n    if <([abs v] of ((Level_X) - (ScrollX)) ) > [480]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [delete all clones v]\nset [level_x v] to [0]\n\nwhen I receive [setup v]\nFind Costume Number\nshow\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nswitch costume to (costume1 v)\nCreate\nhide\n\ndefine Find Costume Number\nset [level costumes v] to [1]\nswitch costume to (costume1 v)\nnext costume\nrepeat until <(costume [number v]) = [1]>\n    change [level costumes v] by (1)\n    next costume\nend\n\n@Transition\n\nwhen I receive [transition in v]\nswitch costume to (costume1 v)\nhide\nshow\nstart sound [Disconnect v]\nrepeat (16)\n    next costume\nend\n\nwhen I receive [transition out v]\nswitch costume to (costume17 v)\nstart sound [Connect v]\nrepeat (16)\n    switch costume to ((costume [number v]) - (1))\nend\nhide\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nhide\n\n