Gravity and ground height.

This commit is contained in:
Mal
2020-01-25 13:11:25 +01:00
parent 388799c97e
commit 0cd532f45a
8 changed files with 316 additions and 27 deletions

View File

@@ -4,10 +4,11 @@ import RetroAnimation from "./retro/RetroAnimation.js";
export default class MrCroc extends Movable
{
constructor() {
super(new RetroAnimation('graphics/mr-croc-walk-right.png', 2, 5), 5);
this.addAnimation('WALK_RIGHT', new RetroAnimation('graphics/mr-croc-walk-right.png', 2, 5, 10));
this.addAnimation('WALK_LEFT', new RetroAnimation('graphics/mr-croc-walk-left.png', 2, 5, 10));
let SCALE = 3;
super(new RetroAnimation('graphics/mr-croc-walk-right.png', 2, SCALE), 7);
this.isJumping = false;
this.addAnimation('WALK_RIGHT', new RetroAnimation('graphics/mr-croc-walk-right.png', 2, SCALE, 10));
this.addAnimation('WALK_LEFT', new RetroAnimation('graphics/mr-croc-walk-left.png', 2, SCALE, 10));
}
moveRight(timestamp, delta = 1)