Added the catapult frame to the game.

This commit is contained in:
The Wobbler 2023-11-19 17:02:17 +01:00
parent f45c7cf98e
commit e0c8405e4b
2 changed files with 9 additions and 0 deletions

View file

@ -83,6 +83,8 @@ def load_block_texture(path: str):
icon_texture = load_texture("textures/icon.png") icon_texture = load_texture("textures/icon.png")
full_icon_texture = load_texture("textures/icon_full.png") full_icon_texture = load_texture("textures/icon_full.png")
full_icon_texture = pygame.transform.scale(full_icon_texture, (260, 90)) 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") stone_block_texture = load_block_texture("textures/terrain/stone_01.png")
dirt_block_texture = load_block_texture("textures/terrain/dirt_01.png") dirt_block_texture = load_block_texture("textures/terrain/dirt_01.png")
grass_block_texture = load_block_texture("textures/terrain/grass_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.fill(summer_sky)
screen.blit(level_surface, (0, screen.get_height() - level_surface.get_height())) 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(): def page_selector():
if page == "main_menu": if page == "main_menu":

View file

@ -3,6 +3,7 @@
import numpy import numpy
level_size = (64, 32) level_size = (64, 32)
catapult_pos = (3, 28)
data_list = [ 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], [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],