Purple Platformer
@Stage\n\n@Sprite1\n\ndefine Platform Physics (jump height) (gravity) (friction) (movement speed) (wall jump vm) (wall jump hm)\nchange y by (yv)\nif <touching (ground v)?> then\n    repeat ([abs v] of (yv) )\n        if <touching (ground v)?> then\n            change y by ((-1) * (([abs v] of (yv) ) / (yv)))\n        end\n    end\n    if <<key (up arrow v) pressed?> and <not <(yv) > [0]>>> then\n        set [yv v] to (jump height)\n    else\n        set [yv v] to [0]\n    end\nelse\n    change [yv v] by (gravity)\nend\nif <key (right arrow v) pressed?> then\n    change [xv v] by (movement speed)\n    switch costume to (right v)\nend\nif <key (left arrow v) pressed?> then\n    change [xv v] by ((-1) * (movement speed))\n    switch costume to (left v)\nend\nchange x by (xv)\nif <touching (ground v)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (xv) ) + (1))\n        if <touching (ground v)?> then\n            if <touching (ground v)?> then\n                change y by (1)\n            end\n        end\n    end\n    if <touching (ground v)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (xv) ) )\n            if <touching (ground v)?> then\n                change x by ((-1) * (([abs v] of (xv) ) / (xv)))\n            end\n        end\n    end\n    if <key (up arrow v) pressed?> then\n        if <(xv) < [0]> then\n            set [xv v] to [0]\n            if <key (left arrow v) pressed?> then\n                set [xv v] to (wall jump hm)\n                set [yv v] to (wall jump vm)\n            end\n        else\n            if <key (right arrow v) pressed?> then\n                set [xv v] to ((-1) * (wall jump hm))\n                set [yv v] to (wall jump vm)\n            end\n        end\n    end\nend\nset [xv v] to ((xv) * (friction))\n\nwhen flag clicked\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    Platform Physics [12] [-1] [0.9] [1] [8] [8]\n    Level Detection\n    if <touching (bad v)?> then\n        go to x: (-205) y: (-46)\n        start sound [pop v]\n    end\nend\n\ndefine Level Detection\nif <(x position) > [248]> then\n    broadcast (next level v)\nend\n\nwhen I receive [next level v]\ngo to x: (-205) y: (-46)\n\n@instructions\n\ndefine set correct tip\nswitch costume to (join [level] ([costume # v] of [ground v]))\n\nwhen flag clicked\nforever\n    glide (0.8) secs to x: (-42) y: (2)\n    glide (0.8) secs to x: (-42) y: (-2)\n    set correct tip\nend\n\n@Ground\n\nwhen I receive [next level v]\nif <not <(costume [number v]) = [8]>> then\n    next costume\nend\nif <(costume [number v]) = [8]> then\n    broadcast (win v)\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\n@win\n\nwhen flag clicked\nhide\n\nwhen I receive [win v]\nshow\n\n