[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Firing bullets



On Mon, 26 Mar 2007, Charles Christie wrote:

> Well, I'm trying to get my program to fire bullets now. Isn't that great?
> 
> I think I'm doing it all wrong though...
> 
> My problem has been that I don't know how to make the program fire bullets.
> But then I thought, "shouldn't the character be firing the bullets, not the
> program?" and it's then that I realized why I couldn't do anything. My logic
> has been completely wrong. Again. Go figure <_<
> 
> Well, I still don't have images for characters yet and I still have no
> movement code (I should probably work on that, huh?) but everything else
> aside from the characters and bullets is done.

A few years ago I wrote some classes for an unfinished game that handled
guns and bullets. You might find them useful.

http://www.mindrot.org/~djm/private/pyrrhus-snap-20070328.tgz

See gun.py in the distribution. It includes a basic damage system and
XML schema to describe models. It is nowhere near as capable as BulletML
(which looks amazing cool) but it is very simple and easy to understand.

The game runs, but lacks sound levels, boss logic and lighting effects. 
It requires PyOpenGL.

-d