Small Flash Game: Forced Fields

Here’s the prototype of a small Flash game for my school assignment. It’s a two player game, an the goal is to hit your opponent. The blue and orange circles are force fields; the blue ones pull your bullet towards them while the red ones push it away. Try to aim with the correct angle and power. You get to move a bit at the beginning of your turn, to avoid enemy fire.

Get Adobe Flash player


At the beginning of your turn, you get to move you character (there’s no meter to indicate how much you can move yet, but will be added soon). After you’re satisfied with your position, press space to enter aiming mode. Use the arrow keys to adjust your power and angle, and press space again to shoot.

The one shown here is re-sized to fit into the post. Click here for the full-sized version.

P.S.: I can’t actually beat it yet. Looks like some level design work needs to be done.

Starlight Engine Progress Update

This post is kinda late….about 6 months late since I started working on my tile based game engine, codenamed Starlight Engine. Anyway, I’m gonna post a quick run through of my current progress, for my own reference in the future.

First a little details about the engine. The engine uses a stack based data structure, where screens are stored in the stack. Screens are basically everything you see in the engine, menus for example. Supposedly I’m currently viewing the main menu, and I pushed the start game button which will take me to the game screen. What happens is that the game screen is pushed to the top of the stack, and the engine updates it and stops updating the screen under it, which is the main menu. If I decided that I wanted to return to the main menu, the engine simply pops the top most screen from the stack, and renders the screen under it. This allows for a more simple way of handling screen transitions, of which I had various problematic encounters with in previous projects. The engine keeps a reference to all of the screens present in the game, and passing the references to classes that request for it.

For this implementation, the screens are updated from top to bottom of the stack, whereas rendering is done from bottom to top. This allow screens to only cover part of the window, while allowing stuff under it to show through. An example is shown below, with a message box only covering part of the screen.

A message box obscuring only part of the screen.

A central texture manager class is created to manage the textures that will be used throughout the game. The TextureManager class loads all textures during startup, and passes out references to classes that require them during runtime. This implementation is to ensure that the textures are loaded only once, and it is also better to reduce disk access later in the game as texture files could end up with a pretty large size.

I also successfully implemented my own text renderer into the engine, which uses bitmap fonts generated by AngelCode’s BMFont tool. This is the first time I’ve ever worked with bitmap fonts, and is quite a challenging experience. The fonts could be limited to wrap within an arbitrary amount of pixels, and can also be aligned left, right and center. Unfortunately, there are a few downsides of using this implementation. The fonts get distorted when scaled, and also adding in a new set of fonts is quite cumbersome.

Text could be aligned and set to wrap within a boundary.

So far, the most important GUI component needed for the game is a button. Creating a MouseListener class is relatively trivial as compared to adding font support. The buttons currently used in the engine are texture mapped quads, with the coordinates hard coded. This should be updated in future revisions.

The main menu, with four buttons. Note that the buttons are actually texture mapped quads.

For the character creation screen, the player will get to insert a name for their character, and therefore I have created a TextInput component. This was also easy, as I already have the font renderer at my disposal. Perhaps with this I could implement a debug console if the need arises.

The character creation screen. Here, the player can insert a name and customize his character.

And finally, after a few days of hair pulling I finally managed to put together basic tile support for the engine. It is currently in its early stages and quite useless, but it should get better after a few days. The tilesets I use are taken from this awesome site. The tiles are originally intended for use with RPG Maker, and therefore I also created a simple tool to expand the tilesets to tiles usable in my engine. Oh and also, I’m using Tiled as my map editor, as it seems to be the most recently updated map editor I could find. I would create my own editor if time allows…maybe after I graduate.

A very primitive tile engine.

And that should be it for now. I’ll update here after I have significant progress to show next time.

A new PC named Pythagoras

And I finally bought it…a new desktop PC! A few not so professional shots from my iPhone 3GS (named Galileo).

The lineup of all the components…

Boxes of the components!

The cool looking mouse!

CM Storm Sentinel Advance and Razer Sphex

The casing: CM Storm Enforcer

CM Storm Enforcer

Inside the body...

The keyboard, Powerlogic Xenon Sabre

Powerlogic Xenon Sabre

The overall look: (thanks to my housemate Min Leong for the table!)

Pythagoras!