Darthfett / A-Priori-Physics-System

A side-scroller game based upon Mega Man X, with a priori collision detection, and objects being represented as a sequence of connected points.
3 stars 0 forks source link

Player's image flips direction even when paused #32

Open Darthfett opened 12 years ago

Darthfett commented 12 years ago

Introduced in bd5d96a Reproducible 100% of the time in 0c4c9f5

The source of this bug has been in the game ever since jetpack controls were added, but this is the first place where it affects gameplay.

Due to the fact that key events are real events, and not game events, when the game is paused, and the player tries to "jetpack_left" or "jetpack_right", it is possible to flip the player's image. Since the game is paused, this should not be happening. In addition, collisions are being recalculated, which is unnecessary while the game is paused.

The expected behavior for using the "jetpack_left", and "jetpack_right" controls is for only the current state of the controls to be recorded. If the game is not paused, the control event shall be created and occur at the current time. When the game is unpaused, all 'game controls' will be compared to their previous states, and if they have changed, an event will fire.

Darthfett commented 12 years ago

There should be a separate key-state and event handler for game events, so that these functions can register as 'game events', rather than 'real events'.