From e0c8405e4b87c2cb20ec336ce4185cf06704aef5 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Sun, 19 Nov 2023 17:02:17 +0100 Subject: [PATCH] Added the catapult frame to the game. --- cowyeet.py | 8 ++++++++ data/levels/1.py | 1 + 2 files changed, 9 insertions(+) diff --git a/cowyeet.py b/cowyeet.py index e723522..8f5f0fc 100644 --- a/cowyeet.py +++ b/cowyeet.py @@ -83,6 +83,8 @@ def load_block_texture(path: str): 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") @@ -197,6 +199,12 @@ 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": 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],