I moved to a new URL! Check it out!

Dev Log: Menus

Dev Log: Menus
I've been a little bit in a heads down mode over the past couple days while working on my video game. I've been posting some updates over on my Twitter in the form of little screenshots and animated gifs, but haven't really written about anything in awhile!

One of the big hurdles to overcome to get this game into a real, actual playable state is making a good menu system. The game is going to be relying a lot on menus for the player to build things in the world, change their equipment, check their status, and who knows what else. I tried looking into some menu frameworks, but I've fallen back onto just making my own menu classes and hard coding everything.

Image


Everything you see here is just made up of two classes: Menu, and MenuButton. Menu can have a list of child Menus, and a list of MenuButtons. MenuButtons have callbacks and such for when they are clicked, rolled over, rolled off, and other handy things. Since everything in this game is controlled by a cursor of some sort, the menu's are a little bit easier to design. Also for now all I have to worry about are buttons. I haven't gone down the path of text input or scroll bars or selection lists, so for now just two little classes will suffice.

Almost all the art in the menus are also made up of NineSlice graphic objects in Otter. NineSlice panels make it really easy to design UI, since the same texture can be used for any size panel. For more info on how NineSlices work, check this out.

That's it for now. Hoping to get a nice logo and officially say what the name of this game is soon (although I've been tagging these posts with the name of it for a few weeks now I think.)

Doodle Post

Image

Dev Log: Boulder Juice

Image


Lately I've been getting a lot done on this game! Actually I'm not totally sure if that's true, but it feels like I've been getting a lot done. I've started to do more organized work blocks which have been working out nicely so far. (I might've mentioned this before.)

While I work away at menus and UI I took a break to work on some good ole fashioned particle effects. Right now the game has boulders that can be harvested for materials to build islands out of. No idea if this is going to be in the final game, but it's fun to blow them up!

Doodle Post

Image

Doodle Post

Image

Dev Log: Enemy Waves

Dev Log: Enemy Waves
Waves of enemies can be a pretty confusing thing to manage. It sounds simple at first, but the amount of ways that you can manage a group of enemies entering the game seems nearly endless. Usually in games where I have waves of enemies I don't have enough time to think of an elegant solution. I just usually end up with some sort of random enemy generator and over time I add more potential enemy types to the pool. This works most of the time but can often lead to really weird patterns, or nearly impossible to survive scenarios if its not tuned correctly.

For this game I have a little bit more time than a weekend to complete it, so this gives me an opportunity to try and come up with a cool solution. For the current design of the game there exist enemy spawner tiles in the game world. These tiles are present from the very start of the session, although all of them might not be active yet.

Enemies can spawn from any one of the active tiles in the scene. There is always at least one active enemy spawner from the start. An enemy wave consists of a list of enemies, and each one of those list entries also knows what enemy spawner they should come from, and how long they should wait before appearing.

When I have a wave ready to go I can add it into my EncounterManager object which will then execute each wave. An enemy wave can either wait for a certain amount of time before spawning the next one, or it can wait for all of the enemies to be cleared before spawning the next one.

So with all of that, this is what it currently looks like to set up enemy waves:
var wave2 = new EnemyWaveProperties()
.Add(typeof(EnemyBitty))
.SpawnFrom(1)
.Add(typeof(EnemyBitty))
.SpawnFrom(0)
.Delay(120)
.Add(typeof(EnemyPopcorn))
.SpawnFrom(1)
.Add(typeof(EnemyPopcorn))
.Delay(120)
.SpawnFrom(0)
.Add(typeof(EnemyBitty))
.Add(typeof(EnemyBitty))
.Add(typeof(EnemyBitty));

EncounterManager.AddAction(new EncounterActionEnemyWave(wave2));
And here's a quick look at what it looks like when the encounter manager is executing an enemy wave action.
public override void Execute() {
foreach(var wave in properties.Waves) {
var spawner = EnemySpawner.GetSpawnerById(wave.SpawnerId);

foreach (var waveEnemy in wave.Enemies) {
if (Spawning) {
if (Timer == waveEnemy.SpawnDelay) {
var enemy = spawner.Spawn(waveEnemy.EnemyType);
EnemiesSpawned.Add(enemy);
SpawnedFirstEnemy = true;
}
}
}
}

if (Timer >= properties.MaxSpawnDelay) {
Spawning = false;
}

if (WaitForClear && SpawnedFirstEnemy) {
var enemiesDead = true;
foreach (var enemy in EnemiesSpawned) {
if (enemy.IsInScene) { // Enemy is still alive
enemiesDead = false;
}
}
if (enemiesDead) {
Finished = true;
EnemiesSpawned.Clear();
}
}
else {
if (Timer >= Time) {
Finished = true;
}
}

Timer++;
}
Nothing too crazy, I think!