Game Development

Game Development Update, Arkanoid clone.

While on vacation from my real job, I spent a bit of time working on a new game.  No, I’ve not wrapped up my Asteroids clone, but I had the urge to do something different so I started my own Breakout/Arkanoid clone.  Is there anyone still out there that doesn’t know what Breakout or any of it’s derivatives are and how they play?   If there is, checkout this video (not by me, just a random one I found) of some that are available on Steam now.

So mine is much more basic than any of those…..here’s a few early screenshot (very early with some graphics that I stole or whipped up really quick…those will change at some point).

malyonball-2 malyonball-1

Nothing real fancy yet.   This game I’m putting together more for fun and hey my young boys are enjoying playing it so far.

One thing I’ve done a little different this time as compared to the Asteroids clone I showed last time, just about everything is based off the Entity class.   Anything that is essentially drawable is an Entity.

Entity is simply an abstract class with just a few properties and methods.  This is it in it’s entirety.


public abstract class Entity
{
  public bool IsDestroyed { get; private set; }
  public Vector2 Position { get; set; }
 
  protected Entity(Vector2 position)
  {
    Position = position;
    IsDestroyed = false;
  }
 
  protected Entity()
  {
    IsDestroyed = false;
  }
 
  public abstract void Update(GameTime gameTime);
  public abstract void Draw(SpriteBatch batch);
 
  public virtual void Destroy()
  {
    IsDestroyed = true;
  }
}

So everything else is inherited from that.  So now my main game loop, my Draw is not much more than

public override void Draw(SpriteBatch batch)
{
  EntityManager.Draw(batch);
}

and my update is:

public override void Update(GameTime gameTime)
{
  EntityManager.Update(gameTime);
}

Makes that all pretty simple. Next time I’ll go into a little more depth on how my EntityManager works, it’s a mishmash of bits of code I’ve found in other places, but it’s really pretty simple and seems to work pretty well for simple games like this.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s