Showing posts with label XNA. Show all posts
Showing posts with label XNA. Show all posts

Wednesday, November 2, 2011

XOut Clone - Shop System

I am working on a clone of the pretty old (1990) amiga game "X-Out" for quite some time now. It intended to be an exercise to get comfortable with XNA Framework.

The most current features I am working on is "some kind of laser beam system" (I should trademark that) and a shop system. Here is a first "design":
A basic "design" how the shop should look like
The basic idea is to use the normal in-game ship movement/rendering to perform the shop tasks (buy/sell items). This is be done by adding items (buttons) that can shot at with the ship's cannon. Player can navigate up/down through items owned to sell them and items offered by the shop to buy them.

To the bottom of the screen "some kind of laser beam system" shields a testing area from the rest where the user can "test use" the recently purchased items.

In-game graphics of the shop
Yes, I know, the colors are pretty nasty. But for testing I need clearly distinguishable colors to place buttons and other visual elements correctly.

So far, navigation through items is working, buy/sell is still a to-do. But the laser already works (but is not yet included in collision detection tests). Also, I'm in need of some ideas for some more extras (especially for the visual design part of it) and how to integrate them in the game configuration files - up to now, pretty much everything (levels, ship design, weapons, enemies,...) is configurable in various XML files.

Tuesday, October 25, 2011

Koch Snowflake - Reloaded

As stated in my last post I played around a bit with Koch Snowflakes and a variation of it.

After figuring out a way to calculate the triangle-count of the next iteration based on the current count it was possible to prevent program crashes due to vertex-/index-buffer overflows.

Another thing made possible is to "merge" the two generation algorithms, i.e. use one method for iteration x and the other for iteration x+1.

The "classic" Koch snowflake algorithm should look something like this:

  1. Start with a triangle (or a tetrahedron made of 4 triangles) and divide every edge in half.
  2. The 3 new points form 4 smaller triangles with half the size.
  3. The triangle in the middle is the base of a new tetrahedron.
  4. Do steps 1 and 3 for every triangle until desired complexity is reached (which is pretty fast).

"Classic" Koch Snowflake subdivision

The variation I (and some others on the web) used nearly does the same, except the smaller tetrahedron is turned that the edges of the smaller base triangle are parallel with the bigger one:


Now I can combine the two different methods to create interesting new patterns. For example:

  1. Start with the initial tetrahedron, then use classic algorithm (C)
  2. Then use variation (V)
  3. Repeat alternations to create the pattern CVCVC
The pattern CVCVC
And some more...
The pattern VCVCV
The pattern CCVVC
The pattern VVCCV
Many more patterns are possible, I was too lazy generating them all. Maybe on personal request...?

Thursday, October 20, 2011

Winter? - Snowflakes!

As the weather suggests it's pretty much winter here. And what's winter without snow?

So I decided yesterday that it would be fun to bring the Koch Snowflake into the third dimension using the XNA Framework and some libraries I'm working on.

Since the result was a bit too regular (see the images on Wikipedia) and I found a nice video on YouTube with something similar but better looking, I changed my code a bit. And voila: Here it is! My version (of many) 3d Koch Snowflakes...

Be prepared, there is (maybe) more to come...

Initial state
After one iteration
After six iterations
If you are interested in the code, feel free to email me at: f(dot)heinz(at)gmx(dot)net

EDIT:
As my girlfriend stated correctly yesterday, this does not look like like a snowflake since I started from a single triangle. So I changed it to a four faced pyramid. This is the result:
After six iterations