itch.io is community of indie game creators and players

Devlogs

#5

SORA - The Lost Kingdom of the Magic Sword - Prototype Ver-
A browser ​solo game developer made in HTML5

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
Download SORA - The Lost Kingdom of the Magic Sword - Prototype Ver-
Leave a comment