Scrolling (A Platformer)

Instructions: Use the arrow keys to control the stick guy! To move onto the next level, get to the green flag! You can also wall jump! Just don't fall off the screen! I can assure you that ALL levels are possile!\nWarning: The game may be slow if you have a slow computer! DO NOT use fullscreen

@Stage\n\nwhen flag clicked\nforever\n    play sound [Elucidate - PaulRHJT v] until done\nend\n\nwhen flag clicked\n\n@Player\n\ndefine touch ground <>\nchange [falling? v] by (1)\nrepeat until <not <touching (ground 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 [scroll y v] to [0]\nend\n\ndefine None\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching (ground 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))\n    if <<key (up arrow v) pressed?> and <([abs v] of (speed) ) > [3]>> then\n        if <(wall jump) = [0]> then\n            set [srcoll x v] to ((-1.2) * (speed))\n            set [scroll y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        end\n    else\n        set [srcoll x v] to [0]\n    end\nend\nchange [frame v] by (0.5)\n\nwhen flag clicked\nshow\nclear graphic effects\ngo to x: (-41) y: (-110)\npoint in direction (90)\nset rotation style [left-right v]\nset size to (50) %\nset [scroll y v] to [0]\nforever\n    switch costume to (hitbox v)\n    if <<(scroll y) < [4]> or <key (up arrow v) pressed?>> then\n        change [scroll y v] by (-1)\n    else\n        change [scroll y v] by (-2)\n    end\n    change y by (scroll y)\n    touch ground <(scroll y) > [0]>\n    if <(wall jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        set [srcoll x v] to ((srcoll x) * (0.7))\n        if <key (left arrow v) pressed?> then\n            change [srcoll x v] by (-1.5)\n        end\n        if <key (right arrow v) pressed?> then\n            change [srcoll x v] by (1.5)\n        end\n    end\n    if <(srcoll x) < [-.5]> then\n        walk (-90) (srcoll x)\n    else\n        if <(srcoll x) > [.5]> then\n            walk (90) (srcoll x)\n        else\n            set [frame v] to [0]\n        end\n    end\n    set x to (0)\n    if <key (up arrow v) pressed?> then\n        if <<(jump key) = [0]> and <(falling?) < [3]>> then\n            set [scroll y v] to [14]\n            set [falling? v] to [5]\n            set [jump key v] to [1]\n        end\n    else\n        set [jump key v] to [0]\n    end\n    switch costume to (stand_1 v)\n    set costume\nend\n\ndefine set costume\nif <(falling?) < [3]> 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 <(scroll y) > [0]> then\n        switch costume to (jump v)\n    else\n        switch costume to (fall v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (_edge_ v)?> and <(y position) < [-120]>> then\n        hide\n        play sound [6327314_8-bit-death-sounds_by_ideafirecreative_preview.mp3 v] until done\n        broadcast (message1 v)\n        point in direction (90)\n        show\n        set y to (-110)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#549a10)?> then\n        start sound [power up v]\n        broadcast (message2 v)\n        point in direction (90)\n        set y to (-110)\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Ground\n\nwhen flag clicked\nset [level # v] to [1]\ngo to x: (555) y: (367)\nset [scroll y v] to [0]\nforever\n    change y by ((scroll y) * (-0.05))\nend\n\nwhen flag clicked\nset [scroll y v] to [0]\nforever\n    change x by ((srcoll x) * (-1))\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset size to (300) %\nswitch costume to (level v)\n\nwhen I receive [message1 v]\ngo to x: (555) y: (367)\nset [scroll y v] to [0]\n\nwhen I receive [message2 v]\nnext costume\nchange [level # v] by (1)\ngo to x: (555) y: (367)\nset [scroll y v] to [0]\n\nwhen flag clicked\nforever\n    if <(Level #) = [18]> then\n        set [level # v] to [End]\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\ngo [backward v] (100000) layers\n\nwhen flag clicked\ngo to x: (0) y: (12)\nset [scroll y v] to [0]\nforever\n    change x by ((srcoll x) * (-0.4))\nend\n\nwhen I receive [message1 v]\ngo to x: (0) y: (12)\nset [srcoll x v] to [0]\n\nwhen I receive [message2 v]\ngo to x: (0) y: (12)\nset [srcoll x v] to [0]\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (109)\nset [scroll y v] to [0]\nforever\n    set size to (100) %\n    go [backward v] (100000000000000) layers\n    change x by ((srcoll x) * (-0.1))\nend\n\nwhen I receive [message1 v]\ngo to x: (0) y: (109)\n\nwhen I receive [message2 v]\ngo to x: (0) y: (109)\n\n@Thumbnail\n\nwhen flag clicked\nclear graphic effects\ngo to [front v] layer\ngo to x: (0) y: (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nforever\n    go to [front v] layer\nend\n\n