No Variables Platformer
@Stage\n\n@ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume0 v)\n\nwhen I receive [next level v]\nnext costume\n\n@lava\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume0 v)\n\nwhen I receive [next level v]\nnext costume\n\n@player\n\nwhen flag clicked\ngo to [back v] layer\nhide\nwait until <key (any v) pressed?>\nwait until <not <key (any v) pressed?>>\nbroadcast (Next level v)\nshow\n\nwhen I receive [jump v]\nJump\nrepeat (20)\n    if < (costume [name v]) contains [jump]?> then\n        Jump move\n        wait (0.01) seconds\n    end\nend\n\ndefine Jump move\nif <not <touching (ground v)?>> then\n    change y by (20)\n    if <touching (ground v)?> then\n        change y by (-20)\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-220) y: (50)\nforever\n    Fall\n    if <key (right arrow v) pressed?> then\n        Move right\n    else\n        if <<key (left arrow v) pressed?> and <not <key (right arrow v) pressed?>>> then\n            Move left\n        end\n    end\n    if <<key (up arrow v) pressed?> and < (costume [name v]) contains [walk]?>> then\n        switch costume to (jump v)\n        broadcast (Jump v)\n    end\n    if <touching (lava v)?> then\n        go to x: (-220) y: (50)\n    end\n    if <(x position) > [230]> then\n        broadcast (Next level v)\n    end\n    wait (0.01) seconds\nend\n\ndefine Fall\nrepeat (round ((timer) * (50)))\n    if <not <touching (ground v)?>> then\n        change y by (-1)\n        if <not < (costume [name v]) contains [jump]?>> then\n            switch costume to (fall v)\n        end\n    end\nend\nif <touching (ground v)?> then\n    if <not < (costume [name v]) contains [jump]?>> then\n        repeat until <not <touching (ground v)?>>\n            change y by (1)\n        end\n        reset timer\n    end\n    switch costume to (walk v)\nelse\n    if <not < (costume [name v]) contains [jump]?>> then\n        switch costume to (fall v)\n    end\nend\n\ndefine Move left\nchange x by (-5)\nif <touching (ground v)?> then\n    change x by (5)\nend\n\ndefine Move right\nchange x by (5)\nif <touching (ground v)?> then\n    change x by (-5)\nend\n\ndefine Jump\nchange y by (10)\nif <touching (ground v)?> then\n    change y by (-10)\nend\n\n
Update 20 Nov 2019: Yeah! This project was added to @s_federici's studio "No variables, thanks!", which was my goal with the project:\nhttps://scratch.mit.edu/studios/34043/\n\nAll "art" and code by me (@kriblo). \n\nAs a game, it's not very challenging, or indeed fun. \n\n#interactive #examples\n#description(An interactive demo of how a platformer could be constructed without using variables or lists. Just for fun.)