Jump to content

Remove the state / Input ?


Costa1337
 Share

Recommended Posts

Quote

        var self = this;
            //wee are now append a key listener to catch enter ;)
            this.game.input.keyboard.addCallbacks(this.background, null, function(data) {
                if(data.keyCode != 13){
                return;
                }
                if(!n.value.trim()){
                    //no value
                    self.error("Please enter your nickname.");
                    return;
                }

                        USERNAME = CONFIG.guest_prefix + n.value.trim();
                        SOCKET.emit("room request", {name: USERNAME});
            }, null);
        },

Every time I enter ingame my player gets duplicated in the room. How can I refuse that state from being active ir that input in phaser?
Please help me i'm really not a javascript expert.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...