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 Components. 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

gemini-rising-win64.zip 6.4 MB
Version v0.15.0 Jun 19, 2022
gemini-rising-osx.zip 30 MB
Version v0.15.0 Jun 19, 2022
gemini-rising.AppImage 7.8 MB
Version v0.15.0 Jun 19, 2022
gemini-rising.love 2.1 MB
Version v0.15.0 Jun 19, 2022

Get Gemini Rising

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.