feat(multiplayer): Add character selection system#3813
Conversation
Implement multiplayer character selection allowing players to choose between Tux, Penny, and Larry. Each character has unique physics attributes (speed, jump force, acceleration, etc) that affect gameplay. Character selections persist across level restarts, save/load cycles, and worldmap transitions when edited during gameplay. Starting from main menu loads the characters selected on the last session. Co-authored-by: Gustavo Alves <gustavoalves@tecnico.ulisboa.pt>
|
Quick skim; probably won't be a while until I (or someone else) reviews this due to its scale and priorities, but: I feel like we should move the list of characters into a separate s-expr file instead of hardcoding it directly in some places. Something like I would probably go ahead and try to have a stab at doing that. Also, we don't do |
Move the hardcoded character list out of CharacterRegistry::initialize_profiles() and into data/characters.stlst, a (supertux-playerlist ...) s-expr file. CharacterRegistry now parses this file at startup using ReaderDocument. This makes it straightforward to add new characters without touching C++ code. Co-authored-by: Gustavo Alves <gustavoalves@tecnico.ulisboa.pt>
|
Thanks for the feedback! I've moved the character list out of C++ into a new data/characters.stlst s-expr file using a (supertux-playerlist ...) root element. CharacterRegistry now parses it at startup via ReaderDocument, following the same pattern used in addon_manager.cpp. Is this what you meant me to do? |
This PR refactors the local multiplayer player initialization to remove hardcoded paths to Tux's sprites, introducing a dynamic Character Profile system. Players (in either multiplayer or singleplayer) can now select between Tux, Penny, and Larry in the multiplayer menu using the arrow keys.
Since full animation sheets for Penny and Larry do not exist yet, we implemented static placeholder sprites to make the feature testable.
This PR also lays the groundwork for future gameplay diversification. By decoupling the player logic from hardcoded assets, the game can now easily be expanded to support characters with unique stats, or new abilities, or gameplay mechanics in the future.
Video Showcase: https://www.youtube.com/watch?v=kMhap_W9TzM