diff --git a/cowyeet.py b/cowyeet.py index 8860e02..8f5f0fc 100644 --- a/cowyeet.py +++ b/cowyeet.py @@ -80,12 +80,18 @@ def load_block_texture(path: str): return pygame.transform.scale(texture, (40 * settings["level_size_multiplier"], 40 * settings["level_size_multiplier"])) +icon_texture = load_texture("textures/icon.png") +full_icon_texture = load_texture("textures/icon_full.png") +full_icon_texture = pygame.transform.scale(full_icon_texture, (260, 90)) +catapult_frame_texture = load_texture("textures/catapult/frame.png") +catapult_frame_texture = pygame.transform.scale(catapult_frame_texture, (66 * 5 * settings["level_size_multiplier"], 31 * 5 * settings["level_size_multiplier"])) stone_block_texture = load_block_texture("textures/terrain/stone_01.png") dirt_block_texture = load_block_texture("textures/terrain/dirt_01.png") grass_block_texture = load_block_texture("textures/terrain/grass_01.png") rock_block_texture = load_block_texture("textures/terrain/rock_01.png") + # coordinate calculations def center_x(width: int): return screen.get_width() / 2 - width / 2 @@ -142,8 +148,7 @@ def load_level(lvl): lvl_width, lvl_height = level_data.level_size - level_surface = pygame.Surface((lvl_width * 40 * settings["level_size_multiplier"], lvl_height * 40 * settings["level_size_multiplier"])) - level_surface.fill(summer_sky) + level_surface = pygame.Surface((lvl_width * 40 * settings["level_size_multiplier"], lvl_height * 40 * settings["level_size_multiplier"]), pygame.SRCALPHA, 32) x = 0 y = 0 @@ -154,7 +159,6 @@ def load_level(lvl): for block in row: rx = x * 40 * settings["level_size_multiplier"] ry = y * 40 * settings["level_size_multiplier"] - print(block) blit_block(block, (rx, ry)) x += 1 @@ -180,8 +184,8 @@ def blit_block(block, position: tuple): level_surface.blit(texture_not_found, position) - def main_menu_page(): + screen.blit(full_icon_texture, (center_x(full_icon_texture.get_width()), 128)) buttons[start_button].blit() @@ -192,8 +196,15 @@ def level_selector_page(): def ingame_page(): + screen.fill(summer_sky) screen.blit(level_surface, (0, screen.get_height() - level_surface.get_height())) + cx, cy = level_data.catapult_pos + cx = cx * 40 * settings["level_size_multiplier"] + cy = screen.get_height() - level_surface.get_height() + cy * 40 * settings["level_size_multiplier"] - catapult_frame_texture.get_height() + + screen.blit(catapult_frame_texture, (cx, cy)) + def page_selector(): if page == "main_menu": @@ -277,6 +288,7 @@ def loop(): screen = pygame.display.set_mode(settings["win_size"], flags=pygame.RESIZABLE) window_size_reload(settings["win_size"]) +pygame.display.set_icon(icon_texture) screen.fill(nero) pygame.display.update() diff --git a/data/levels/1.py b/data/levels/1.py index c93f3ab..dbeb046 100644 --- a/data/levels/1.py +++ b/data/levels/1.py @@ -3,6 +3,7 @@ import numpy level_size = (64, 32) +catapult_pos = (3, 28) data_list = [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], diff --git a/textures/catapult/arm.png b/textures/catapult/arm.png index c43cea8..cade248 100644 Binary files a/textures/catapult/arm.png and b/textures/catapult/arm.png differ diff --git a/textures/catapult/frame.png b/textures/catapult/frame.png new file mode 100644 index 0000000..a271ffa Binary files /dev/null and b/textures/catapult/frame.png differ diff --git a/textures/gimp/catapult/arm.xcf b/textures/gimp/catapult/arm.xcf index a4f4657..9b83dd4 100644 Binary files a/textures/gimp/catapult/arm.xcf and b/textures/gimp/catapult/arm.xcf differ diff --git a/textures/gimp/catapult/frame.xcf b/textures/gimp/catapult/frame.xcf new file mode 100644 index 0000000..85246ac Binary files /dev/null and b/textures/gimp/catapult/frame.xcf differ diff --git a/textures/icon.png b/textures/icon.png new file mode 100644 index 0000000..afc07d9 Binary files /dev/null and b/textures/icon.png differ diff --git a/textures/icon_full.png b/textures/icon_full.png new file mode 100644 index 0000000..787f1b9 Binary files /dev/null and b/textures/icon_full.png differ