diff --git a/graphics/mr-croc-walk-left-christmas.png b/graphics/mr-croc-walk-left-christmas.png new file mode 100644 index 0000000..bd85a4e Binary files /dev/null and b/graphics/mr-croc-walk-left-christmas.png differ diff --git a/graphics/mr-croc-walk-right-christmas.png b/graphics/mr-croc-walk-right-christmas.png new file mode 100644 index 0000000..feb2dcb Binary files /dev/null and b/graphics/mr-croc-walk-right-christmas.png differ diff --git a/js/MrCroc.js b/js/MrCroc.js index 84b1de1..460efec 100644 --- a/js/MrCroc.js +++ b/js/MrCroc.js @@ -6,10 +6,15 @@ export default class MrCroc extends Movable { constructor() { 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.addAnimation('WALK_RIGHT', new RetroAnimation(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right.png', 2, SCALE, 10)); - this.addAnimation('WALK_LEFT', new RetroAnimation(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left.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 + animationLeft, 2, SCALE, 10)); } moveRight(timestamp, delta = 1)