INCLUDE_DATA

Generic Game Menus

Game Menus

Finally, an update! It’s been about five, six or so days since I updated last time about Vm and Charm. I’ve been wanting to update really bad, but the stuff I’ve been working on until now has been quite dull to report about. Mostly it’s been some code cleaning. However, I’ve run this latest progress through my main idol of game-worship Kael (check his site out!) and he thought it was ok to tell you about my generic game menus.

So here goes. First a movie!

Note: Fire 1, Fire 2 etc are just test-spells, the names for the real spells will be things like “Flicker”, “Char” and so forth and have different uses. I’m quite sure I won’t do the whole Fire, Fira, Firaga thing FF does, or any sort of Fire Bolt 1, Fire Bolt 2, like World of Warcraft. Each spell will be different and usable throughout the game is my intention. (this part added to Concept & Design)

This movie shows a few things, let me walk you through why this not so spectacular-looking menu is great in some ways!

This first game menu is created by deriving from a class approperiately named GameMenu. Something like this.

public class ItemMenu : GameMenu { … }

What it does is, handle most things. Like the categories scrolling (All, Consume, Equip and Quest items) and keeps track of how you’ll be able to scroll through each item.

In this case, one Item has Quantity, it has flags that tell if it’s consumable, equippable, nonsell, nondiscard and so forth. It might have mindamage and maxdamage values because it’s a Weapon and so forth. This is all nice and being able to filter for any of these sorts is a handy function. What becomes really nice is that the second menu is done like this..

public class SpellMenu : GameMenu { … }

It inherits the same baseclass and uses the same UI and rules, except that I can override a few things that makes it behave differently. Like the filter categories, spells aren’t consumable, equippable and so forth, they don’t share the same information items do. So we need to make GameMenu be as generic as possible, even allowing custom filtering. Which the SpellMenu does, it filters on All, Fire-spells, Water-spells, Earth-spells.. etc so instead we check Spell for it’s SpellElement flag which contain this information and filter the list approperiately.

If you switch Fire 1 with Fire 3, so that the order in the general list is Fire 3, Fire 2 and then Fire 1, that’s how the filtered Fire-spell list will look as well. It basically just skips any non-fire spell. These filters can be as customized as you’d want from a developer’s view. I could filter out all the Earth-spells of level 3 and higher AND all the Fire-spells of level 6 and higher, to appear in one list and exclude all the others.

Enough about game menus..!

Other

I have been working on stencil buffers as well, and eventhough I have no video, I have had some progress on it. Took me a long while to figure out just how to get spritebatches to cope with writing to a mask that I can decide myself by drawing into the buffer first. It’s going to allow me for some simple swiping effects (like when something appears/disappears one horizontal line at a time).

Gruedorf

For any new viewer, let me tell you a short thing about Gruedorf and why it’s so awesome for all of us!

All competitors are making games, and the goal is to update your blog ATLEAST once every week, this makes the circle of gruedorfers a rather updated blogosphere to keep track of. So, my advice to you is that if you fancy more than my little indie project, check the others out as well. My nickname there is “zaril” and I update atleast once every week, so keep yourself updated! There’s RSS to help ya!

Link: Gruedorf

Share This!
  • Digg
  • Reddit
  • del.icio.us
  • Facebook
  • Google
  • Technorati
  • TwitThis
  • Slashdot

Tags: , , ,

Leave a Reply

You must be logged in to post a comment.