Dwarfsoft [GPA]

XNA on the Second Day

by on Mar.05, 2009, under Game Development, XNA


Print This Post Print This Post

Breakout after XNA on the Second Day

Breakout after XNA on the Second Day

So I started attempting to write a game within a Day and blogged about it in “XNA in a Day… Almost“. Firstly I feel the need to explain some of the decisions that were made: I really didn’t have any preparation time, no prior experience with the Framework or the Language. I came in hacking things together instead of planning what I was going to do. I tried not to refactor code too much once it was in place.

The reason for this was that no matter how bad the game ended up, it would do mostly what it was told, and in the process I would have completed the project and have gained some valuable insight into both my own programming methodology, and into the XNA framework from start to finish.

I have decided not to paste all the code into this page, as it got quite hacky, even moreso than last time. I haven’t included the code also due to the fact that it can be considered a way NOT to make a game. There are things in the game that really should have been designed in order to work effectively. Anyway, to run the game you will need XNA 3.0 and the .NET Framework.

Breakout Game Binary
Breakout game Project Files

Also: I do understand that the game is not exactly polished. There is no backing music, there is only the sound effect for collisions, and the Vector of the ball from restart is not increased. There is, however, some level progression. For each “level” increased, the Maximum Vector of the Ball and Paddle increases by 1 in X and Y (obviously the paddle doesn’t increase in Y though ๐Ÿ™‚ ).

Things I Learned, which I posted over at A XNA Experience

  1. A SpriteManager class would be very useful (instead of relying on the Collision class)
  2. The Different Sprites should have their own Class Inherited from Sprite, so that Movement is not so Hacked
  3. Collisions should Callback to the Game class so that appropriate scoring need not be Hacked.
  4. Offscreening all the Block Sprites in one location really does make the Collision Detection System Workโ€ฆ. badly (as none of the Blocks ever move because of their collision, its a waste of resources) ๐Ÿ™‚
  5. Collisions should only be checked on the Moving object, not all objects, so as to save some of those precious cycles.
  6. For some reason when the ball and paddle head toward each other and collide on a diagonal, the ball gets stuck. I still haven’t figured this out, but it should be fixed by having a Class for the Paddle and a Class for the Ball with their own unique Move()/Collision detection functions.

At some point in the future I would like to attempt to remake the game, with the above elements taken on board, and see how long it takes to finish a polished game from that basis point. Effectively this game is like a prototype so that important design decisions can be extracted for the real thing.

I will consider what my next project will be and what time frame I expect to be able to complete it in.

Cheers, Chris.

:, , , , ,

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!