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 jtremesaygues

Hello,

I'm writing a platform game with Impact, and I use the same controls as Biolab on mobile devices.
Sometime, when I release a button, the corresponding "touchend" event is never fired and ig.input.state(myaction) always return true, so if the problem occurs with the left button or with the right button, my character never stop walking no matter if I press or not the button...

Does anyone have already encountered the same problem?


More informations :
- I use the last version of Impact (v1.22)
- the game is playable here : http://crabegame.com/
- I have added some ig.log on touchStart and touchEnd of ig.input for visualize fired events
- the issue is quite rare, but very annoying.

1 decade ago by jtremesaygues

I have modified touchStart and touchEnd like this:
    touchStart: function( event, action ) {
        if (this.state(action)) {
            // The button is already pressed, so we send first a touchEnd
            this.touchEnd(event, action);
        }

        this.actions[action] = true;
        this.presses[action] = true;

        event.stopPropagation();
        event.preventDefault();
        return false;
    },


    touchEnd: function( event, action ) {
        if (this.released(action) || !this.state(action)) {
            // the button is already released, so we ignore the event
            return;
        }

        this.delayedKeyup[action] = true;
        event.stopPropagation();
        event.preventDefault();
        return false;
    }

The bug still occurs, but now, if I press again on the "locked button", my character is stopping.
Page 1 of 1
« first « previous next › last »