Saturday 17 December 2011
Blackshift has a lot of simple but versatile objects: doors that open, grills that kill you, blocks that you push around, and so on. Sometimes it's fun to try and implement something a bit more complex.
This week it's sticky blocks — they act like normal blocks, but if two of them end up next to each other they stick together and from then on they always move as a unit. The only way to unstick them afterwards is to destroy one with an explosion.
I've implemented these rather naively. Instead of being clever and keeping a list of what connects to what, I just compute the connected set each time you try and push a sticky block. You'd think that would be too inefficient, but I've tried it with large clumps of blocks and it seems fine. Maybe I'll have to optimize it later, but for now I'll keep doing it the simple way.
If you watch the video you'll notice I haven't made any graphics for the blocks yet. I think a good way to work is to implement a bunch of features without any graphics, then have a graphics binge later when I'm feeling graphicsy.
Next time: collectible items, because they're a big part of the game and I haven't done 'em yet.