Development Blog (semi)random.thoughts()

April 2020

Bye bye callbacks! Combining Combine and SpriteKit

Consider a simulation game. The game probably has some entities, wether it's cities, cells, soldiers or reindeer. Now consider it is a turn based game, where the simulation advances on a "tick" basis. Before and after the tick, the state of the simulation will have changed, so for instance your cells might have a different color and your reindeer might have moved. Your visualization should update accordingly.

Due to the complexity usually involved with simulation models, your modal is probably a self contained unit, that perhaps knows nothing about UI stuff. Or it shouldn't anyway, because why would it care? Can we use Combine with SpriteKit to simulate the "automagical updating" of SwiftUI. Yes we can!

Read More…

Codable conformance for ECS system revisisted

In the post I demonstrated a way of adding Codable conformance to the GameplayKit ECS system. For another game I'm working on (HexEngine, source here: https://github.com/maartene/HexEngine) I experimented with a different solution, that I now feel is more elegant.
Read More…

We value your privacy. This site collects only information required to provide you this Service. For more information, read our privacy policy.