canvas-platformer | HTML5 platform game done in Canvas | Game Engine library
kandi X-RAY | canvas-platformer Summary
kandi X-RAY | canvas-platformer Summary
HTML5 platform game done in Canvas
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of canvas-platformer
canvas-platformer Key Features
canvas-platformer Examples and Code Snippets
Community Discussions
Trending Discussions on canvas-platformer
QUESTION
I am trying to make a 2D platforming game and I am missing an essential part of it, gravity.
I have tried everything from look at questions on this website to looking at online tutorials and you-tube videos.
I really need help with getting gravity into this game as I am out of ideas.
As I said I have already tried looking at multiple tutorials and videos, including this one:
http://www.somethinghitme.com/2013/01/09/creating-a-canvas-platformer-tutorial-part-one/
but this one uses shapes created in canvas rather than images.
I already know that you have to use a velocity function as well as variable for the gravity. Then you have to put this all inside the key handler function so that it can get executed.
...ANSWER
Answered 2019-Jun-18 at 14:24You should be using gravity to update your position every frame (in the draw function). This would look like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install canvas-platformer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page