I am creating a demo that has a hop movement or a glide movement. The movements work ok. If I set the instance variable movement_type to 0 or 1, either works fine.
However when I use buttons to switch the movement type, the left and right keys no longer work.
I have posted a simplified version of the code (left-right only). If anyone can point out why its wrong I would be very grateful - I have spent ages on this.
Develop games in your browser. Powerful, performant & highly capable.
that is because buttons stay focused after a click, and intercept keyboard entry.
that the end of the Button On Clicked events, add a Button Set Unfocused action.
Add "Btn Set Unfocused" to events 2 and 3, see if it helps.
Or better yet, don't use buttons or other form controls in your game, make buttons with sprites instead.
It works !
That's awesome guys. Thanks for your timely help.