nsccs / pygames

Collection of games created with pygame.
4 stars 4 forks source link

add basic projectile management #13

Closed znschaffer closed 9 months ago

znschaffer commented 9 months ago

ref #11

Added some basic scaffolding for handling projectiles:

Right now, projectiles are living in a List, and being appended using some current information from the ship that fired them

Projectile(self.ship.pos, self.ship.direction, self.ship.calc_forward_facing_velocity(1), self.ship.total_sprite_rotation)

This could be simplified to maybe just passing in the ship's reference and extracting this mess inside the __init__.

Projectiles have a cleanup flag on them - flipped to True if the Game detects they've hit a screen boundary. Would extend this check to asteroid collision after those are implemented.

znschaffer commented 9 months ago

Yup all ready to go for now!