mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-26 23:23:08 +02:00
fix(frontend): fix game replay
This commit is contained in:
parent
7e52ea4818
commit
f5b864df7b
1 changed files with 3 additions and 2 deletions
|
@ -500,12 +500,13 @@ export class DropAndFusionGame extends EventEmitter<{
|
||||||
});
|
});
|
||||||
this.emit('changeStock', this.stock);
|
this.emit('changeStock', this.stock);
|
||||||
|
|
||||||
const x = Math.min(this.gameWidth - this.PLAYAREA_MARGIN - (head.mono.size / 2), Math.max(this.PLAYAREA_MARGIN + (head.mono.size / 2), Math.round(_x)));
|
const inputX = Math.round(_x);
|
||||||
|
const x = Math.min(this.gameWidth - this.PLAYAREA_MARGIN - (head.mono.size / 2), Math.max(this.PLAYAREA_MARGIN + (head.mono.size / 2), inputX));
|
||||||
const body = this.createBody(head.mono, x, 50 + head.mono.size / 2);
|
const body = this.createBody(head.mono, x, 50 + head.mono.size / 2);
|
||||||
this.logs.push({
|
this.logs.push({
|
||||||
frame: this.frame,
|
frame: this.frame,
|
||||||
operation: 'drop',
|
operation: 'drop',
|
||||||
x,
|
x: inputX,
|
||||||
});
|
});
|
||||||
Matter.Composite.add(this.engine.world, body);
|
Matter.Composite.add(this.engine.world, body);
|
||||||
this.activeBodyIds.push(body.id);
|
this.activeBodyIds.push(body.id);
|
||||||
|
|
Loading…
Reference in a new issue