Compare commits
No commits in common. "ae0c61282b611a3a079ff9b6c6efb1df24b1407a" and "f6ebd8f3aab1d9802db9287b136b9e089dc6d2b7" have entirely different histories.
ae0c61282b
...
f6ebd8f3aa
Binary file not shown.
Before Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.8 KiB |
11
js/MrCroc.js
11
js/MrCroc.js
@ -6,15 +6,10 @@ 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 + animationRight, 2, SCALE, 10));
|
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 + animationLeft, 2, SCALE, 10));
|
this.addAnimation('WALK_LEFT', new RetroAnimation(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left.png', 2, SCALE, 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
moveRight(timestamp, delta = 1)
|
moveRight(timestamp, delta = 1)
|
||||||
|
10
js/module.js
10
js/module.js
@ -34,19 +34,13 @@ function mainLoop(timestamp)
|
|||||||
|
|
||||||
if (game.KeyLoad.isPressed()) {
|
if (game.KeyLoad.isPressed()) {
|
||||||
const dialog = new LoadLevelDialog();
|
const dialog = new LoadLevelDialog();
|
||||||
|
dialog.onClose = () => {
|
||||||
dialog.onClose = () => {
|
|
||||||
dialog.close();
|
dialog.close();
|
||||||
game.isPaused = false;
|
game.isPaused = false;
|
||||||
window.requestAnimationFrame(mainLoop);
|
window.requestAnimationFrame(mainLoop);
|
||||||
}
|
}
|
||||||
dialog.onLoad = (data) => {
|
dialog.onLoad = (data) => {
|
||||||
EventBus.clear();
|
EventBus.clear();
|
||||||
|
|
||||||
for (const effect of game.level.fullscreenEffects) {
|
|
||||||
effect.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
loadLevel(Level.createFromJson(data));
|
loadLevel(Level.createFromJson(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,8 +55,6 @@ function loadLevel(level)
|
|||||||
const loader = new ImageLoader();
|
const loader = new ImageLoader();
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right.png');
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left.png');
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-right-christmas.png');
|
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'mr-croc-walk-left-christmas.png');
|
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-right.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-right.png');
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
||||||
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
loader.addImage(Setting.GRAPHICS_LOCATION + 'gisela-left.png');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user