Becoming a game developer in the most roundabout way possible
February 23, 2012Posted by on
Two things have happened since my last post: random world generation, and explosions. I could explain at length the great tribulation that went into producing these blasts, but I know that the first thing on your mind is explosions.
There. I wound up writing a Blast class for myself, because Farseer’s included Explosions.cs takes only ints as user data, a value I am using in a different manner. After struggling with Explosions.cs for a good day-and-a-half, I finally gave up and wrote Blast in about 20 minutes. It still has some kinks to work out, but all in all, those explosions are looking pretty good. They’ll be even better when they have an animation.
Only slightly cooler is the random world generator. Originally, I was going to use Perlin noise, but after looking at the implementation at http://devmag.org.za/2009/04/25/perlin-noise/, I decided to hack together my own little process. The top has an 80% chance of being grass and a 20% chance of being nothing, for some reason or another. The sides are always stone, but I intend on changing that to some indestructible thing. Inside the world, there’s a 30% chance of stone, and the rest is dirt. Not that any of these really behave differently yet, but I do intend on changing their behavior around a little.
Taking advantage of the any-dimension world generation can lead to Fun: