nsccs / pygames

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

Implement Shoot #11

Closed jaredscarr closed 9 months ago

jaredscarr commented 9 months ago

Space bar should trigger shooting. Shooting should be continuous stream of shots as long as the space bar is held down.

SayYesToTrees commented 9 months ago

This seems kinda straight forward. The ship could have a shoot method. The only thing I think is tricky is keeping track of the projectile movement. I think the part im having a hard time with is whether the ship should keep track of its projectiles or if it should spawn and return the projectile references to somewhere else.

Edit: I guess it could be an array owned by the game class. That makes sense to me.

jaredscarr commented 9 months ago

Yeah, I would do so,es research first, but that seems reasonable and simple. A projectile class that tracks its position and velocity. Could even use an active/inactive flag to reuse objects. Start with the simplest approach possible first 🙂