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

Re: [pygame] Shooting an object



OK, for shooting, you want to have a class of Bullet.  When the enemy fires, add an instance of bullet.  The bullet's position will be the enemy's position, and the speed will be a constant broken into x and y components with cos(radians(angle)) and sin(radians(angle)).  Each frame, you add the speed of the bullet to the bullet's position.