#5
Refactored the player architecture today.
Previously:
- most logic was concentrated inside Sora.gd
- scene structure and gameplay responsibilities were mixed together
- scaling to multiple playable characters would become difficult
To solve this, I started migrating the system to a BasePlayer architecture.
Changes
Introduced BasePlayer
Created:
- BasePlayer.gd
- shared player logic
Moved common systems into BasePlayer:
- movement
- dodge roll
- damage
- attack
- auto weapons
- pulse animation
Switched to Scene Inheritance
Changed from script-only inheritance to full scene inheritance.
BasePlayer.tscn
↑
Sora.tscn
This now allows:
- shared node structures
- easier character expansion
- sprite replacement workflows
- future character select support
Problems Encountered
null instance errors
Invalid access to property 'speed' on null instance
Cause:
- only script inheritance was used
- scene inheritance was not configured correctly
Fix:
- rebuilt Sora as an inherited scene from BasePlayer
Important Learning
In Godot:
- script inheritance
- scene inheritance
are completely different systems.
For character architecture, combining both is extremely important.
Next Steps
Continue separating responsibilities inside the player structure:
BasePlayer ├ visual ├ stats ├ combat └ character unique
Future plans:
- Character Select
- unique skills
- character abilities
- animation variations
Get SORA - The Lost Kingdom of the Magic Sword - Prototype Ver-
SORA - The Lost Kingdom of the Magic Sword - Prototype Ver-
A small indie action game focused on exploration and combat.
| Status | In development |
| Author | GOZOHO |
| Genre | Action, Adventure |
| Tags | 2D, Casual, Indie, Pixel Art, Retro, Singleplayer |
Leave a comment
Log in with itch.io to leave a comment.