added shooting
This commit is contained in:
parent
7b27ac29e8
commit
cf21f5ff0a
4 changed files with 38 additions and 1 deletions
3
main.py
3
main.py
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue