Learn You a Game Jam 2024 - Day 4


This is a Blog daily update for Learn You a Game Jam 2024

Goal of Day: Create new Character entity, which can be controlled by AI instead of just inputs

Today I worked on a major refactor. The 'Player' class has been handling a lot of logic related to moving and animating the character about. I moved a lot of this logic to a new class Character. This way, multiple characters can be instantiated in the level, only one of which is controlled by the Player (so is a child node of Player node), but others can be AI-controlled instead via the same movement calls.

Some care is needed to ensure Player correctly waits for the tween completion signal from the character before it submits another move.

Here's what the Node structure now looks like:


Next time I will be able to create enemies programmatically, which will be new instances of Character, which have an AI parent script instead of Player.

Leave a comment

Log in with itch.io to leave a comment.