Comparing 2D Collision Detection and Hit-Testing Approaches in Godot 3

Teaser image

I played around with Godot and found that when my player character moved too fast, it would not collect items in its path. Here’s a short visual comparison of two approaches to move things in an engine like Godot. If you don’t know Godot: it is an engine, tool, and IDE to create cross-platform 2D and 3D games and GUIs. It’s basically Unity, but open source.

Continue reading …

How to Decode Human-Readable JSON Strings to Integer-Based Swift.OptionSet

I want to decode JSON that’s human readable but still represents a Swift.OptionSet. Traditionally, OptionSets are implemented with an integer-based rawValue, because that gives you the set algebra for free. Here’s my type: Here, all represents the whole text of a document, for example, and selected stands for the current selected text, if any.

Continue reading …