New answers tagged html5
0
I see three likely errors, commented below. Try this and edit your question to describe the symptoms if it's still misbehaving.
this.hitBottom = function() {
var rockbottom = myGameArea.canvas.height - this.height;
if (this.y > rockbottom) {
this.y = rockbottom;
this.gravitySpeed = 0;
}
} // This curly brace was missing.
this....
Top 50 recent answers are included
Related Tags
html5 × 500javascript × 312
html-canvas × 166
2d × 29
browser-based-games × 24
isometric × 20
collision-detection × 16
phaser × 16
node.js × 16
multiplayer × 15
web × 15
mobile × 14
unity × 13
webgl × 13
android × 11
game-design × 11
animation × 11
performance × 11
websocket × 11
physics × 10
sprites × 10
game-loop × 10
tilemap × 9
tiles × 9
maps × 9