Skip to content

Commit

Permalink
[fix] boostcampwm-2022#112 응급처치!! - input창 입력 중 키 안먹히는 에러
Browse files Browse the repository at this point in the history
- window에 이벤트를 걸었으나....개선이 필요...
- 색상 디버그 주석처리
  • Loading branch information
JJongBin committed Dec 8, 2022
1 parent d463172 commit bc10b59
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions frontend/src/component/Game/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export default class Game extends Phaser.Scene {
data.socket
);

const debugGraphics = this.add.graphics().setAlpha(0.7);
this.townLayer.renderDebug(debugGraphics, {
tileColor: null,
collidingTileColor: new Phaser.Display.Color(243, 234, 48, 255),
});
// const debugGraphics = this.add.graphics().setAlpha(0.7);
// this.townLayer.renderDebug(debugGraphics, {
// tileColor: null,
// collidingTileColor: new Phaser.Display.Color(243, 234, 48, 255),
// });

this.physics.add.collider(this.myPlayer, this.townLayer);

Expand All @@ -74,6 +74,13 @@ export default class Game extends Phaser.Scene {
emitter.on('updateHair', (hair: string) => {
this.myPlayer?.updateHair(hair);
});

window.onclick = (e: MouseEvent) => {
const elem = e.target as HTMLElement;
const checkInput = elem.tagName === 'INPUT';

this.input.keyboard.manager.enabled = !checkInput;
};
}

preload() {
Expand Down

0 comments on commit bc10b59

Please sign in to comment.