One of the most difficult-to-figure out aspects of making this early version of Island God work is “colonization.” If you’ve been reading my posts on Island God, you’ll know that there are three core encounter types to deal with: animals in danger, lava, and human colonization. So far, I have a pretty good handle on how lava and animals work in the game, but up until recently I simply could not get a satisfying human encounter working in the game.
The idea was simple:
A colony ship sails toward the island from either the North, the South, or the West.
The colony ship would anchor where it meets the island perimeter.
The colony ship would offload colonists.
The colonists would do damage to the island until Island God intervened (by destroying the ship).
Repeat.
Early versions of the colonization mechanic had the ship (a sprite) dock with the island and after a set amount of time, begin to generate the colonists (smaller sprites). The problem with this is that the programming required to get this mechanic working properly was a little more than I could handle at this point in time. So I figured I’d try a trick that would more or less provide the same kind of experience, with much less of a programming hassle.
In the above p5.js sketch, I’m using “visible” and “collide” (both functions in p5.play) to do a couple of different things:
I’ve already created five colonials and placed them on the island, but I’ve made them invisible.
When the ship docks at the island (by colliding with it), the colonials all get set to visible and start wreaking havoc (they actually don’t do anything at the moment but scream).
If the Island God destroys the ship by touching it (achieved with the “overlap” function), the colonials’ visibility gets set off again.
The ship is then respawned at a different section of the map and heads toward the island to repeat the process again.
The sketch above is interactive, by the way. You can click into it and use WASD to move around and take out the ship or watch what happens when it makes land. You can check the thing is all its glory here (with code). It is not mobile friendly!
The idea is to now integrate this prototype with the other working elements of Island God v1. Furthermore, I’ll attempt to have these elements interact with one another, independent of the player (as discussed in my GDD posts). I only have a few days left before Island God is due, so it’ll be a mad dash to the finish line.
Wish me luck!