Undo actor animation (fixes #4)
This commit is contained in:
parent
684021f93d
commit
ade135514b
11
js/game.js
11
js/game.js
@ -795,10 +795,9 @@ export class Level {
|
|||||||
if (actor.cell === goal_cell)
|
if (actor.cell === goal_cell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO undo this stuff?
|
this._set_prop(actor, 'previous_cell', actor.cell);
|
||||||
actor.previous_cell = actor.cell;
|
this._set_prop(actor, 'animation_speed', speed);
|
||||||
actor.animation_speed = speed;
|
this._set_prop(actor, 'animation_progress', 0);
|
||||||
actor.animation_progress = 0;
|
|
||||||
|
|
||||||
let original_cell = actor.cell;
|
let original_cell = actor.cell;
|
||||||
this.remove_tile(actor);
|
this.remove_tile(actor);
|
||||||
@ -1078,8 +1077,8 @@ export class Level {
|
|||||||
spawn_animation(cell, name) {
|
spawn_animation(cell, name) {
|
||||||
let type = TILE_TYPES[name];
|
let type = TILE_TYPES[name];
|
||||||
let tile = new Tile(type);
|
let tile = new Tile(type);
|
||||||
tile.animation_speed = type.ttl;
|
this._set_prop(tile, 'animation_speed', tile.type.ttl);
|
||||||
tile.animation_progress = 0;
|
this._set_prop(tile, 'animation_progress', 0);
|
||||||
cell._add(tile);
|
cell._add(tile);
|
||||||
this.actors.push(tile);
|
this.actors.push(tile);
|
||||||
this.pending_undo.push(() => {
|
this.pending_undo.push(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user