Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def __init__(self):
self.player_frames = {}
self.load_player_frames()

self.unicorn_bullet = self.load_unicorn_bullet() # Preload unicorn bullet
self.unicorn_bullet = self.load_unicorn_bullet() # Preload unicorn bullet

def load_player_frames(self):
sprite_path = os.path.join("assets", "sprites", "characters", "Player.png")
Expand All @@ -31,7 +31,7 @@ def load_unicorn_bullet(self):
try:
image = pygame.image.load(path).convert_alpha()
scaled = pygame.transform.scale(image, (32, 32))
print("[DEBUG] Unicorn bullet loaded:", scaled.get_size())
#print("[DEBUG] Unicorn bullet loaded:", scaled.get_size())
return scaled
except Exception as e:
print(f"[ERROR] Could not load unicorn bullet: {e}")
Expand Down
7 changes: 4 additions & 3 deletions bullet.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ def __init__(self, x, y, target_x, target_y, color=(0, 0, 0), shooter=None, imag
self.rect = pygame.Rect(0, 0, BULLET_SIZE, BULLET_SIZE)
self.rect.center = (x, y)

# Apply rotation if image provided
# Apply rotation if image provided
if self.original_image:
try:
rotated = pygame.transform.rotate(self.original_image, -self.angle_deg + 180)
self.image = rotated
self.image_rect = self.image.get_rect(center=self.rect.center)
print("[Bullet] Rotated image created successfully")
#print("[Bullet] Rotated image created successfully")
except Exception as e:
print("[Bullet ERROR] Rotation failed:", e)
self.image = None
self.image_rect = None
else:
print("[Bullet] No image provided, using color:", self.color)
pass
#print("[Bullet] No image provided, using color:", self.color)

def update(self):
self.rect.x += self.dx
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
NPC_SPEED = 2

SCREEN_WIDTH = 1024
SCREEN_HEIGHT = 1024
SCREEN_HEIGHT = 800


GAME_FPS = 50
Expand Down
2 changes: 1 addition & 1 deletion enemy_unicorns.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, x, y):
# Load bullet image
self.assets = Assets()
self.bullet_image = self.assets.unicorn_bullet
print("[DEBUG] Bullet image set:", type(self.bullet_image))
#print("[DEBUG] Bullet image set:", type(self.bullet_image))

self.animate()

Expand Down
24 changes: 12 additions & 12 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
def show_menu(screen):
"""Main game menu"""
font = pygame.font.Font(None, 36)
menu_options = ["1: Single player",
"2: Cooperative",
menu_options = ["1: Single player game",
"2: Cooperative game",
"ESC: Ukončení"]

while True:
screen.fill((43, 28, 88))
for i, option in enumerate(menu_options):
text = font.render(option, True, (255, 255, 255))
screen.blit(text, (50, 200 + i * 40))
screen.fill((43, 28, 88))
for i, option in enumerate(menu_options):
text = font.render(option, True, (255, 255, 255))
screen.blit(text, (270, 320 + i * 40))

pygame.display.flip()

pygame.display.flip()
while True:

for event in pygame.event.get():
if event.type == pygame.QUIT:
return "quit"
if event.type == pygame.KEYDOWN:

print("Key pressed:", event.key)
if event.type == pygame.KEYDOWN:

if event.key == 49: #pygame.K_1:
if event.key == 49:
return GameType.SINGLE
if event.key == 50: #pygame.K_2:
if event.key == 50:
return GameType.COOP

if event.key == pygame.K_ESCAPE:
Expand Down
Loading