1 decade ago by gnesher
Hi,
I've got a really odd bug with Safari and FF - the player entity can only move a few pixels left/right and gets stuck (works fine in Chrome).
I'm basically using the code from the examples:
if( ig.input.state('left') ) {
this.vel.x = -this.speed;
}else if( ig.input.state('right') ) {
this.vel.x = this.speed;
}else{
this.vel.x = 0;
}
I've consoled log into left/right states - they are being called (repeatedly) and the vel is changing. Can't figure out what's the problem.
Changing the vel to position (manually moving the entity) does work - but that's not much of a solution (and will fail for things like jumping).
Any ideas?
I've got a really odd bug with Safari and FF - the player entity can only move a few pixels left/right and gets stuck (works fine in Chrome).
I'm basically using the code from the examples:
if( ig.input.state('left') ) {
this.vel.x = -this.speed;
}else if( ig.input.state('right') ) {
this.vel.x = this.speed;
}else{
this.vel.x = 0;
}
I've consoled log into left/right states - they are being called (repeatedly) and the vel is changing. Can't figure out what's the problem.
Changing the vel to position (manually moving the entity) does work - but that's not much of a solution (and will fail for things like jumping).
Any ideas?