Varcade Dev Blog

Explosions and Waves

by on Mar.05, 2010, under Games

Looking around the XNA site and still learning a lot, I found I nice example of smoke and explosions in the Particles Example. This was fairly simple to get in the game, and shows how to use a DrawableGameComponent, and also my first look at how an inherited class can call a specific constructor of it’s base. This guide on C# constructors was helpful.

I’ve created  the concept of a Enemy Wave, a group of enemies to be deployed. I made a couple more placeholder enemies graphics an gave each type is own class inherited from gameObject. making them easy to create and manage.  I put a ‘startbox’ at the beginning of the path, and check if its empty of enemies ( meaning the last deployed enemy has got out of the way), and deploy more if it is.

The white circle is the cursor, but I’m calling it the Picker.  It moves with the left thumbstick, and you can accelerate its movement my using the left trigger. It’s working pretty well in place of a mouse.  I’ve created a color map to determine if the picker is over certain areas.

The code for that looks like:

currentLevel.backgroundMask.GetDat(0, selectRect, pixelData, 0, pixelData.Count());

     foreach (Color color in pixelData)
     {
         // test is everything in White
         if (color != Color.White)
         {

            isSelectable = false;
            break;
          }

      }

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...