Files
Examples/JavaScript/dino-game/world.js
2018-07-16 11:18:23 +01:00

23 lines
353 B
JavaScript

class World {
constructor() {
this.gravity = 1;
this.ground = 300;
}
update() {
}
draw() {
ctx.beginPath();
ctx.moveTo(0, this.ground + 40 - 7);
ctx.lineTo(800, this.ground + 40 - 7);
ctx.stroke();
}
reset() {
this.gravity = 1.3;
this.ground = 300;
}
}