drawing first map onto screen

This commit is contained in:
2023-12-09 21:27:24 +01:00
parent 81c7c552f9
commit cdf6a810ec
7 changed files with 16 additions and 1 deletions

View File

@ -4,6 +4,7 @@ from pygame.locals import *
from Classes.Objects.Cards.MonsterCard import MonsterCard
from Classes.System.Window import Window
from Classes.System.InputHandler import InputHandler
from Classes.System.World import World
class App:
@ -23,6 +24,9 @@ class App:
# create sprite groups
cards = pygame.sprite.Group()
# game word
world = World(pygame.image.load("Assets/Arenas/default.png").convert_alpha())
testMonsterCard = MonsterCard((500,500), "Assets/Cards/MonsterCards/testmonstercard/")
cards.add(testMonsterCard)
@ -30,6 +34,9 @@ class App:
self.__clock.tick(self.__FPS)
self.__window.getScreen().fill("grey100")
world.draw(self.__window.getScreen())
# update sprite groups
cards.update()

View File

@ -37,5 +37,4 @@ class Window:
# draws a passed sprite group to the screen
def drawSpriteGroup(self, group:pygame.sprite.Group):
self.__screen.fill("grey100")
group.draw(self.__screen)

View File

@ -0,0 +1,9 @@
import pygame
class World():
def __init__(self, mapImage):
self.__map = mapImage
def draw(self, surface:pygame.Surface):
surface.blit(self.__map, (0,0))