KotLC Platformer
@Stage\n\n@sophie\n\ndefine Set up\ngo to x: (-200) y: (0)\nset [level v] to [1]\nset [xv v] to [0]\nset [yv v] to [0]\nshow\n\ndefine Reset\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-200) y: (0)\n\ndefine Left and right Movement\nchange [xv v] by (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\nset [xv v] to ((Xv) * (0.9))\nchange x by (Xv)\n\ndefine Wal and Slope Detection\nrepeat (5)\n    change y by <touching (platform v)?>\nend\nif <touching (platform v)?> then\n    change x by ((Xv) * (-1))\n    change y by (-5)\n    if <key (up arrow v) pressed?> then\n        if <(Xv) > [0]> then\n            set [xv v] to [-5]\n        else\n            set [xv v] to [5]\n        end\n        set [yv v] to [12]\n    else\n        set [xv v] to [0]\n    end\nend\n\ndefine Ground and Ceiling Detection\nif <touching (platform v)?> then\n    change y by ((Yv) * (-1))\n    set [yv v] to [0]\nend\n\ndefine Up and Down Movement (jump height)\nGround and Ceiling Detection\nchange y by (-1)\nif <<touching (platform v)?> and <key (up arrow v) pressed?>> then\n    set [yv v] to ((jump height) + (1))\nend\nchange y by (1)\n\ndefine Main Game Loop\nLeft and right Movement\nWal and Slope Detection\nchange [yv v] by (-1)\nchange y by (Yv)\nUp and Down Movement [13]\nif <(x position) > [235]> then\n    Reset\n    change [level v] by (1)\n    broadcast (message1 v)\nend\nif <key (r v) pressed?> then\n    Reset\nend\nif <<(y position) < [-178]> or <touching (danger v)?>> then\n    Reset\nend\nif <touching (trampoline v)?> then\n    set [yv v] to [20]\nend\n\nwhen flag clicked\nSet up\nforever\n    Main Game Loop\nend\n\nwhen flag clicked\nshow\nforever\n    if <key (down arrow v) pressed?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (left arrow v) pressed?> then\n        switch costume to (costume2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        switch costume to (costume1 v)\n    end\nend\n\nhide\n\n@danger\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    switch costume to (level)\nend\n\n@Platform\n\nwhen flag clicked\nshow\ngo to [front v] layer\nforever\n    switch costume to (level)\nend\n\nhide\n\n@trampoline\n\nwhen flag clicked\nforever\n    switch costume to (level)\nend\n\n@Sprite1\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    go to x: (0) y: (0)\n    switch costume to (level)\nend\n\n@Sprite2\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\n
arrow keys \npart 2 at 23 likes and 17 stars\nPart 2 is out ! : https://scratch.mit.edu/projects/600986024/