1 decade ago by gxxaxx
I am working on a set of games for Android. One of the things I notice about playing these games is the following:
When transitioning from one level to the next there is a strong tendency for the input state to get stuck in the true condition.
This means the character will keep running until the player taps the forward button down then up again.
To solve this I'm trying the following code in my level change method:
with this code in the ig.input
I have not done much work in the input area of impactjs.
And, I am ultra nervous about hacking the core files.
But, I can't see anyway around this at the moment.
So two questions:
1) Has anyone solved this without the core hack of input.js?
2) Is there a glaring "ooops" screw-up anyone can see in this type of solution?
When transitioning from one level to the next there is a strong tendency for the input state to get stuck in the true condition.
This means the character will keep running until the player taps the forward button down then up again.
To solve this I'm trying the following code in my level change method:
ig.input.clearStates();
with this code in the ig.input
clearStates: function() { for( var action in this.actions ) { this.actions[action] = false; this.locks[action] = false; } this.delayedKeyup = {}; this.presses = {}; },
I have not done much work in the input area of impactjs.
And, I am ultra nervous about hacking the core files.
But, I can't see anyway around this at the moment.
So two questions:
1) Has anyone solved this without the core hack of input.js?
2) Is there a glaring "ooops" screw-up anyone can see in this type of solution?