Geeks With Blogs



Add to Technorati Favorites

An Archived Managed World This blog has moved to

Okay, just one last update before I head off and hit the sack. I was able to get the Wall game object written. I also just wrapped up my CollisionDetectionService so I have collision detection working in my game now. For now, the collision detection is rather rudimentary. It just uses bounding boxes along with the RectangleF.Intersects() method in the .NET Framework to do bounding volume collision detection. Pretty simple, but pretty effective (I may not even have to change it for the rest of the project).

I'm liking how the collision detection reads. I'll have to show that at a later time though (maybe in my retrospective?). I'm also storing a "cache" of collisions so you don't see "Ball1 collided with Wall1" and "Wall1 collided with Ball1" as two separate collisions. All my game objects derive from a common GameObject base class which has an ID property that is generated by producing a new Guid. So, the "cache key" that I'm using is basically xor'ing the hashcode of both objects' Guids together. Once again, pretty simple.

My one concern with the collision detection algorithm now is that it is brute force (checking every object against every other game object). Since this game is a simple 2D game that may not grow that complex in regards to the number of game objects, I'm hoping this algorithm will continue to work. If not, I'll look at moving the game object repository to storing by quadtree or something like that to better cut down on the number of collision checks that I'm having to do.

With this progress, I'm thinking that I can spend Friday night and Saturday working on plugging in some enemies (e.g. the Spaceballs that will gives the game its name), getting the scoreboard working, and perhaps getting health on the ship working as well. All in all, I'm happy with where I am. I'm well on my way to getting a functional tracer bullet up and running in a week or so. Then I can start working on polishing the game up (aka making the game look pretty and be fun).

Good night, all!

Posted on Thursday, May 25, 2006 6:22 AM Game Development | Back to top

Comments on this post: Spaceballs - Day 7, Part 2

# re: Spaceballs - Day 7, Part 2
Requesting Gravatar...
Man! You are really trucking along! Sounds like it's going to be fully playable in just a short while. I'd better get moving or you're going to be starting on a second game since you finished your first so quickly ;)
Left by George on May 25, 2006 6:43 AM

# re: Spaceballs - Day 7, Part 2
Requesting Gravatar...
I hope to be playable in a short while :). At least, that's the goal. Once it is playable, then I can work some more on making it "fun" and making it look nice. First things first, though :).
Left by Jason Olson on May 25, 2006 9:50 AM

Your comment:
 (will show your gravatar)

Copyright © Jason Olson | Powered by: