added shooting

This commit is contained in:
specCon18 2025-01-21 02:54:02 -05:00
parent 7b27ac29e8
commit cf21f5ff0a
4 changed files with 38 additions and 1 deletions

View file

@ -4,6 +4,7 @@ from constants import *
from player import Player
from asteroidfield import AsteroidField
from asteroid import Asteroid
from shot import Shot
def main():
@ -22,6 +23,7 @@ def main():
drawables = pygame.sprite.Group()
updatables = pygame.sprite.Group()
asteroids = pygame.sprite.Group()
shots = pygame.sprite.Group()
# Set the containers of the astroids
Asteroid.containers = (asteroids,drawables,updatables)
@ -35,6 +37,7 @@ def main():
# Set the position of the player
p1 = Player(SCREEN_WIDTH/2,SCREEN_HEIGHT/2)
Shot.containers = (shots,drawables,updatables)
while True:
# if event is quit then kill the game
for event in pygame.event.get():