Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by noGrip

Hi guys,

I'm having a problem. It seems that, at least with chrome, sometimes my functions are being called twice. I give you an example:

	update: function() {
		if (this.state == 'INITIAL'){
			console.log("enters initial");
			this.placeTiles();
                        this.state = 'PRE_GAME';
		}

                if (this.state == 'PRE_GAME'){
			//other stuff
		}

       }

I then check the javascript console on chrome, and realize that the message "enters initial" appears twice. Any ideas? Is this a browser problem?

Thank you

Paulo

1 decade ago by noGrip

Nevermind, I am also using sockets.io, and in the init of the entity I had a socket.emit('xpto') call.
Page 1 of 1
« first « previous next › last »