Speedrun Platformer (my first platformer) v1.6
@Stage\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen flag clicked\nplay sound [Techno2 v] until done\nforever\n    play sound [Techno3 v] until done\nend\n\nset [☁ highscore v] to [100]\n\n@Player\n\nwhen flag clicked\ngo to x: (-220) y: (-80)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nset rotation style [left-right v]\nforever\n    Platform [11.5] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        start sound [Crunch v]\n        go to x: (-220) y: (-80)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (finish v)?> then\n        start sound [Collect v]\n        change [level v] by (1)\n        go to x: (-220) y: (-80)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nswitch costume to (hitbox v)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n        end\n    end\n    if <<(([abs v] of (Y Velocity) ) / (Y Velocity)) = [-1]> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>>> then\n        set [y velocity v] to (jump height)\n        start sound [Low Whoosh v]\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (idle v)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (fall v)\nend\n\nwhen flag clicked\nset [walk v] to [5]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [8]> then\n        set [walk v] to [5]\n    end\n    wait (0.05) seconds\nend\n\nwhen flag clicked\nhide variable [timer v]\nhide variable [score v]\nhide variable [☁ highscore v]\nwait until <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nreset timer\nforever\n    set [timer v] to (timer)\nend\n\n@Level\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@Finish\n\nwhen flag clicked\nshow\nforever\n    next costume\n    wait (0.05) seconds\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [1]> then\n        go to x: (190) y: (-120)\n    end\n    if <(Level) = [2]> then\n        go to x: (190) y: (-120)\n    end\n    if <(Level) = [3]> then\n        go to x: (190) y: (-120)\n    end\n    if <(Level) = [4]> then\n        go to x: (190) y: (132)\n    end\n    if <(Level) = [5]> then\n        go to x: (184) y: (100)\n    end\n    if <(Level) = [6]> then\n        go to x: (-215) y: (100)\n    end\n    if <(Level) = [7]> then\n        go to x: (190) y: (133)\n    end\n    if <(Level) = [8]> then\n        go to x: (200) y: (138)\n    end\n    if <(Level) = [9]> then\n        go to x: (200) y: (20)\n    end\n    if <(Level) = [10]> then\n        go to x: (-200) y: (0)\n    end\n    if <(Level) = [11]> then\n        broadcast (Finish v)\n        wait (0.1) seconds\n        stop [all v]\n    end\nend\n\nwhen I receive [finish v]\nhide\n\n@Spikes\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@Noise Texture\n\nwhen flag clicked\n\ngo to x: (0) y: (0)\nset size to (120) %\nforever\n    go to [front v] layer\n    set [ghost v] effect to (90)\nend\n\n@Overlay Texture\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nset [ghost v] effect to (85)\n\n@Sprite1\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [finish v]\nshow variable [score v]\nshow variable [☁ highscore v]\nshow\n\nwhen I receive [finish v]\nswitch backdrop to (finish v)\nwait (0.1) seconds\nset [score v] to (timer)\n\nwhen I receive [finish v]\nif <(Score) < (☁ Highscore)> then\n    set [☁ highscore v] to (Score)\n    wait (0.1) seconds\n    stop [all v]\nend\n\n@Thumbnail 1\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\nwhen flag clicked\nhide\n\n
< MY FIRST PLATFORMER >\n—————————————————————————\n[ How To Play ]\n\n[ ENGLISH ]\n> WASD or ARROW KEYS To Move \n> Space or Up Arrow To Jump\n> Avoid Spikes \n> Get to the flag \n> Not Mobile Friendly\n\nHAVE FUN!\n—————————————————————————\n[ DEUTSCH ]\n> WASD oder PFEILTASTEN um zu bewegen\n> Leertaste oder Pfeil hoch um zu springen\n> Spikes vermeiden\n> zur Flagge kommen\n> keine Steuerung für Mobile\n\nVIEL SPAß!\n\n~ 5ivee