add images

This commit is contained in:
anna
2026-06-16 15:25:27 +08:00
parent 150c127fd6
commit a1ad32432d
8 changed files with 6 additions and 154 deletions

11
main.py
View File

@@ -19,7 +19,10 @@ min_spawn_interval = 0.2
spawn_timer = 0
game_time = 0
def on_mouse_mmove(pso , rel , buttons):
sword.x = pos[0]
sword.y = pos[1]
def spawn_dinosaurs():
dino = Actor("dino")
@@ -48,9 +51,7 @@ def update(dt):
if spawn_timer >= spawn_interval:
spawn_dinosaurs()
spawn_timer = 0
sword.pos = mouse.pos
for dino in dinosuars[:]:
dx = apple_x - dino.x
dy = apple_y - dino.y
@@ -61,7 +62,7 @@ def update(dt):
if dino.colliderect(sword):
dino.image = "dead"
corpses.append({"Actor":dino,"die_time": game_time})
sounds.hit.play()
sounds.hit.play(hit.mp3)
dinosuars.remove(dino)
for corpse in corpses[:]: