https://github.com/scriptraccoon/jump-and-run-template
basic template for jump and run games in an HTML canvas with vanilla JS
https://github.com/scriptraccoon/jump-and-run-template
Last synced: over 1 year ago
JSON representation
basic template for jump and run games in an HTML canvas with vanilla JS
- Host: GitHub
- URL: https://github.com/scriptraccoon/jump-and-run-template
- Owner: ScriptRaccoon
- License: mit
- Created: 2020-06-06T19:23:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-26T00:04:02.000Z (over 2 years ago)
- Last Synced: 2024-05-30T16:49:54.527Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Jump and Run Template
Demo: https://jump-and-run-template.netlify.app
This is a template for jump and run games in Vanilla Javascript.
There are classes for
- rectangles (which cannot be moved)
- boxes (which can be moved by the player)
- players (which can walk and jump and push boxes)
In particular, the box class has some elementary physics (velocity, acceleration, gravity, friction) and collision detection. Players are seen as special boxes which can be controlled via the arrow keys and have the trait of pushing boxes.
The animation is done by the timer class which is borrowed from [this repo](https://github.com/meth-meth-method/super-mario).