diff --git a/images/sword.png b/images/sword.png new file mode 100644 index 0000000..a4a3aae Binary files /dev/null and b/images/sword.png differ diff --git a/main.py b/main.py index b200223..0f1c4d5 100644 --- a/main.py +++ b/main.py @@ -14,10 +14,29 @@ sword = Actor("sword") dinosuars = [] corpses = [] +spawn_interval = 2.0 +min_spawn_interval = 0.2 +spawn_timer = 0 +game_time = 0 + def draw(): screen.fill((100,220,100)) apple.draw() + +def spawn_dinosaur(): + dino = Actor("dino") + side = random.randint(0,3) + if side == 0: + dino_x = random.randint(0.WIDTH) + dino_y = -50 + elif side == 1: + dino_x = random.randint(0,WIDTH) + dino_y = HEIGHT + 50 + elif side == 2: + dino_x = WIDTH + 50 + dino_y = random.randint(0,HEIGHT) + dinosuars.append(dino) pgzrun.go() \ No newline at end of file