Monday, January 18, 2010

Daily Developer: Day 17 part 2

I spent a second round this evening adding expanding to the target spawning phase. The concept behind the game is that there are targets that spawn randomly, that if left untouched, grow additional targets to the north, south, east and west of them. This was implemented effortlessly, partly due to the TargetManager I implemented yesterday.

The issue now is that there is a clear need to optimize my collision detection. Getting the basic elements of the game in place, I used simple methods that I knew I would need to refactor later. The collision detection works fine for small numbers of projectiles and targets, but not as well when there are larger numbers of both objects.

I spent some time browsing the XNA forums and found some suggestions. Most of them involve dividing the objects into groups that need to be checked for collisions, and those that don't. For what I am doing, probably the easiest to do would be to use a grid, dividing the gameboard into much smaller sections. Then, each object will be sorted into the box it is in prior to collision checking occurring.

Working on optimizing the collision detection will be my goal for tomorrow.

Duration: 01:07:29

No comments:

Post a Comment