Add First Version of Tuto
PopUp Player Control disable Fake bubble displayed
This commit is contained in:
parent
fa4d917729
commit
c5c8770a60
8 changed files with 174 additions and 65 deletions
|
@ -31,10 +31,11 @@ export class ActiveEventList {
|
|||
export class UserInputManager {
|
||||
private KeysCode!: UserInputManagerDatum[];
|
||||
private Scene: GameScene;
|
||||
|
||||
private isInputDisable : boolean;
|
||||
constructor(Scene : GameScene) {
|
||||
this.Scene = Scene;
|
||||
this.initKeyBoardEvent();
|
||||
this.isInputDisable = false;
|
||||
}
|
||||
|
||||
initKeyBoardEvent(){
|
||||
|
@ -65,14 +66,21 @@ export class UserInputManager {
|
|||
|
||||
clearAllKeys(){
|
||||
this.Scene.input.keyboard.removeAllKeys();
|
||||
this.isInputDisable = true;
|
||||
}
|
||||
|
||||
restoreAllKeys(){
|
||||
this.initKeyBoardEvent();
|
||||
this.isInputDisable = false;
|
||||
}
|
||||
getEventListForGameTick(): ActiveEventList {
|
||||
const eventsMap = new ActiveEventList();
|
||||
if (this.isInputDisable) return eventsMap;
|
||||
this.KeysCode.forEach(d => {
|
||||
if (d. keyInstance.isDown) {
|
||||
eventsMap.set(d.event, true);
|
||||
}
|
||||
|
||||
});
|
||||
return eventsMap;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue