Driftwood2D / Driftwood

Driftwood 2D Tiling Game Engine and Development Suite
http://tileengine.org/
MIT License
24 stars 1 forks source link

Changing areas is broken #179

Closed pmer closed 7 years ago

pmer commented 7 years ago

The area doesn't switch and we get the following error message once you lift you finger off the arrow key:

[83] WARNING: Tick: unregister: attempt to unregister nonexistent callback: _process_walk
pmer commented 7 years ago

@seisatsu Could you take a look at this one?

As far as I can tell, at the moment changing areas in pixel-mode requires that _process_walk() be called one last time after the entity stops walking.

_stop_walk() runs:

https://github.com/seisatsu/Driftwood/blob/e34d2b3477c5b3f0a8df97c01973d0f0e658b129/src/entity.py#L1112

And then _process_walk() runs:

https://github.com/seisatsu/Driftwood/blob/e34d2b3477c5b3f0a8df97c01973d0f0e658b129/src/entity.py#L1128-L1129

Now not self.walking evaluates to True so we run the logic to switch areas.

However, as of abd137990a0a2bc62f892fe98f182477dc475903, _stop_walk() now removes _process_walk() from the tick manager so it doesn't get called anymore.