Mr. Croc Christmas version implemented
This commit is contained in:
parent
f6ebd8f3aa
commit
b70d327f89
BIN
graphics/mr-croc-walk-left-christmas.png
Normal file
BIN
graphics/mr-croc-walk-left-christmas.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
BIN
graphics/mr-croc-walk-right-christmas.png
Normal file
BIN
graphics/mr-croc-walk-right-christmas.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
11
js/MrCroc.js
11
js/MrCroc.js
@ -6,10 +6,15 @@ export default class MrCroc extends Movable
|
|||||||
{
|
{
|
||||||
constructor() {
|
constructor() {
|
||||||
const SCALE = 2;
|
const SCALE = 2;
|
||||||
super(new RetroAnimation(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right.png', 2, SCALE), 7);
|
|
||||||
|
const month = new Date().getMonth();
|
||||||
|
const animationRight = month === 11 ? 'mr-croc-walk-right-christmas.png' : 'mr-croc-walk-right.png';
|
||||||
|
const animationLeft = month === 11 ? 'mr-croc-walk-left-christmas.png' : 'mr-croc-walk-left.png';
|
||||||
|
|
||||||
|
super(new RetroAnimation(Setting.GRAPHICS_LOCATION + animationRight, 2, SCALE), 7);
|
||||||
this.isJumping = false;
|
this.isJumping = false;
|
||||||
this.addAnimation('WALK_RIGHT', new RetroAnimation(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right.png', 2, SCALE, 10));
|
this.addAnimation('WALK_RIGHT', new RetroAnimation(Setting.GRAPHICS_LOCATION + animationRight, 2, SCALE, 10));
|
||||||
this.addAnimation('WALK_LEFT', new RetroAnimation(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left.png', 2, SCALE, 10));
|
this.addAnimation('WALK_LEFT', new RetroAnimation(Setting.GRAPHICS_LOCATION + animationLeft, 2, SCALE, 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
moveRight(timestamp, delta = 1)
|
moveRight(timestamp, delta = 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user