-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserving players and grabbed objects between sectors #2596
Preserving players and grabbed objects between sectors #2596
Conversation
Previously, each sector would contain its own instances of the `Player` object for each available player. This, however, makes it tedious to preserve player data across sectors, for example, the currently grabbed object. `GameObjectManager` now supports moving objects to another `GameObjectManager`. Now, the `Level` instantiates all `Player`s in the "main" sector, and each sector, on activation, moves those players to itself, so it can manage them, essentially making players global for the level. This allows retaining the full state of all players, between sectors. Any grabbed/carried object by a player is also moved between sectors, together with the player. Additionally, a fix for the slow moving animation of grabbed objects, when teleporting while carrying them, is included. Carried objects now teleport together with the player. Fixes SuperTux#2191.
This pull request seems to break trampoline collision. I noticed the trampoline doesn't have The only time the 2023-08-22.14-39-53.mp4 |
6d09519
to
c686f42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing keys, otherwise works great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keys work too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after a quick look, it's completely fine
Previously, each sector would contain its own instances of the
Player
object for each available player. This, however, makes it tedious to preserve player data across sectors, for example, the currently grabbed object.GameObjectManager
now supports moving objects to anotherGameObjectManager
.Now, the
Level
instantiates allPlayer
s in the "main" sector, and each sector, on activation, moves those players to itself, so it can manage them, essentially making players global for the level. This allows retaining the full state of all players, between sectors.Any grabbed/carried object by a player is also moved between sectors, together with the player.
Additionally, a fix for the slow moving animation of grabbed objects, when teleporting while carrying them, is included. Carried objects now teleport together with the player.
Fixes #2191.