Two Paths - A Platformer (DEMO)
@Stage\n\nwhen flag clicked\nset [level v] to [1]\n\n@Player\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\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?>>> then\n        switch costume to (player 2 v)\n        set [y velocity v] to (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\n\nwhen flag clicked\ngo to x: (-223) y: (-121)\nset [y velocity v] to [0]\nset [x velocity v] to [0]\nforever\n    Platform [12] [-1] [0.7] [2.356]\n    if <touching (spikes v)?> then\n        go to x: (-223) y: (-121)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (finish v)?> then\n        change [level v] by (1)\n        go to x: (-223) y: (-121)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\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.07) seconds\nend\n\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) < [-2]> then\n    switch costume to (fall v)\nend\n\nwhen flag clicked\nforever\n    if <touching (spikes v)?> then\n        play sound [Disconnect v] until done\n    end\nend\n\n@Level\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@Spikes\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen backdrop switches to [backdrop2 v]\nshow\nswitch costume to (spikes 1 v)\n\nwhen I receive [nextlevel v]\nnext costume\n\nwhen backdrop switches to [backdrop2 v]\nshow\nswitch costume to (spikes 1 v)\n\nwhen backdrop switches to [backdrop2 v]\nshow\nswitch costume to (spikes 1 v)\n\n@Finish\n\nwhen flag clicked\nforever\n    if <(Level) = [1]> then\n        go to x: (208) y: (-68)\n    end\n    if <(Level) = [2]> then\n        go to x: (208) y: (-70)\n    end\nend\n\nwhen flag clicked\nforever\n    next costume\n    wait (0.05) seconds\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nshow\n\n
In this platformer every level has 2 different paths to choose from to pass each level \nUsually the long path is easier and the short path is harder\nWASD/ Arrow Keys to Move/Navigate\n(If we get 75 loves and favs then I'll consider making a full game) \n:)\n