@chris need helo wuth health

This commit is contained in:
cramsey
2026-01-14 09:47:19 -05:00
parent e01d866eaa
commit 885f3de38f
8 changed files with 163 additions and 11 deletions

23
point_system.py Normal file
View File

@@ -0,0 +1,23 @@
(update)
score = 100
player_rect = pygame.Rect(50, 50, 40, 40)
obstacle_rect = pygame.Rect(200, 50, 40, 40)
if player_rect.colliderect(obstacle_rect):
score -= 10
can_lose_points = True
cooldowm_time = 1000 #miliseconds
last_hit_time = 0
current_time = pygame.time.get.ticks()
if player_rect.colliderect(obstacle_rect) and can_lose_points:
score -= 10
can_lose_points = False
last_hit_time = current_time
if not can_lose_points and current_time - last_hit_time > cooldown_time:
can_lose_points = True