Speak and Shout

Tuesday, November 21, 2006

Asteroids, part 3

I've got explosions working now for the asteroids. The ship now breaks apart when it hits an asteroid and regenerates properly (i.e. waits for a break in the asteroids before regenerating so you don't instantly die). I also found a site with the original sounds from the Asteroids arcade game, so the sound is much better now.

At work, we had our boring 2 hr. team meeting on Monday afternoon, so I used the time to make some quick calculations on remaining features to add. I estimate about 14 hours remaining before completion, including the code cleanup and documentation.

My dad is coming to visit for a few weeks starting at Thanksgiving, so I expect things to slow down a lot over that time period. However, I still may be able to get it into the stores before Christmas. :-)

Labels:

Friday, November 17, 2006

Asteroids, part 2

Collision detection now works. Sound is partially done. pygame.Sound.play() works on any available channel ... unfortunately, when the game loop runs every 20-30 ms, playing one sound consumes all available channels and sounds like crap. I have to figure out how to make one sound play until finished on one channel ... it's not as simple as it, uh, sounds.

Labels:

Thursday, November 16, 2006

Asteroids with Pygame

Remarkably, my Asteroids project is coming along. It's a big kick to see things happening on the screen. All the engine code is there now, so it's pretty straightforward to add the individual pieces.

The collision detection works, but it's a little flakey. It works most of the time for detecting ship-to-asteroid hits, but it doesn't work at all for the small shot-to-asteroid hits. I'm spending a lot of CPU time on detecting collisions, so I will either have to optimize the code or use Psyco on the final product.

I think I may eventually write an article on the making of this game. There aren't enough good (read: advanced) PyGame tutorials out on the web, and I would imagine I would get a lot of hits from interested programmers.

UPDATE: See the final game. Source code included.

Labels: