No longer using state to pass messages
v.0.15.0:
- Message passing in
GameObject
. - i18n is working.
- Badges!
- Hacking service works more automatically, less code in the Components.
When the player stomps on a switch or a goblin, or a goblin bonks into another goblin or a bridge, I needed some way to tell the game object, “Hey, something happened to you.”
Originally this was with the GobState
component. It saves state that applies to the game object and writes it into the quicksave and save files (or, at least it will once I start writing to the file system). That way, the bridge stays knocked over and switches stay pushed if they’re marked that way on the map.
This became the way I sort of passed events around between game objects in the game, even momentary ones. And it lead to weird bugs and lots of extra code: set the state to bonked
, but unset it a while later (and why is that going in the save file anyway?). Is that thing bonked
? Lots of weird message subscriptions and stuff, too.
So I scrapped all that and added a message-passing mechanism to GameObject
. It’ll make it out to Squeak.lua pretty soon, as well. Pretty simple: each GameObject
has a sendMessage
that calls onMessage
on all the Component
s. Easy.
Anything with a momentary effect uses the built-in cooldowns component that ships with Squeak. Duh.
As always, this broke lots of stuff. But I think things are better in the end.
And, of course, the game looks basically the same. It just makes it easier for me to add stuff in the future and not worry about breaking everything.
Files
Get Gemini Rising
Gemini Rising
A puzzle platformer about evading and hacking grumpy bots.
Status | In development |
Author | drhayes |
Genre | Platformer |
Tags | LÖVE, Metroidvania, Pixel Art, Puzzle-Platformer |
Languages | English |
Accessibility | Configurable controls |
More posts
- A crane to pick up enemies!Dec 30, 2022
- Hacking bots worksFeb 19, 2022
- Weird map bug and bad initial animationFeb 07, 2022
- Double-jump!Feb 06, 2022
- Built from feedback: push buttons!Feb 05, 2022
- A couple more levels, two more puzzlesFeb 02, 2022
- Possession mechanics!Jan 29, 2022
- Goblins can wear helmetsJan 26, 2022
- A bit of particle workJan 25, 2022
Leave a comment
Log in with itch.io to leave a comment.