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.