53 lines
3.1 KiB
Python
53 lines
3.1 KiB
Python
import pygame
|
|
from Classes.Objects.BoardField import BoardField
|
|
|
|
class World():
|
|
__boardFields:list
|
|
__cardWidth:int = 150
|
|
__cardHeight:int = 200
|
|
__cardOffset:int = 400
|
|
|
|
def __init__(self, cardWidth:int=150, cardHeight:int=200, cardOffset:int=400):
|
|
self.__boardFields = []
|
|
self.__cardWidth = cardWidth
|
|
self.__cardHeight = cardHeight
|
|
self.__cardOffset = cardOffset
|
|
self.buildGameWorld()
|
|
|
|
def buildGameWorld(self):
|
|
# construct elements arround the playerfield
|
|
# Todo add lifepoint label for player and enemy and make them scriptable
|
|
eRow1Height = 105
|
|
eRow2Height = (self.__cardHeight + 110)
|
|
pRow1Height = ((2 * self.__cardHeight) + 145)
|
|
pRow2Height = ((2 * self.__cardHeight) + self.__cardHeight + 150)
|
|
|
|
eDeckPos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 0)), eRow1Height)
|
|
eGravePos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 0)), eRow2Height)
|
|
pGravePos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 5)), pRow1Height)
|
|
pDeckPos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 5)), pRow2Height)
|
|
|
|
self.__boardFields.append(BoardField("EnemyDeck", "Enemy", "Deck", eDeckPos, (self.__cardWidth, self.__cardHeight), (0,255,0)))
|
|
self.__boardFields.append(BoardField("EnemyGraveyard", "Enemy", "Grave", eGravePos, (self.__cardWidth, self.__cardHeight), (0,255,0)))
|
|
self.__boardFields.append(BoardField("PlayerDeck", "Player", "Deck", pDeckPos, (self.__cardWidth, self.__cardHeight), (255,0,0)))
|
|
self.__boardFields.append(BoardField("PlayerGraveyard", "Player", "Grave", pGravePos, (self.__cardWidth, self.__cardHeight), (255,0,200)))
|
|
|
|
for i in range(5):
|
|
pMonsterPos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * i)), pRow1Height)
|
|
pEffectPos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * i)), pRow2Height)
|
|
eMonsterPos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * (i+1)), eRow1Height))
|
|
eEffectPos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * (i+1))), eRow2Height)
|
|
|
|
self.__boardFields.append(BoardField("PlayerMonsterField-"+str(i), "Player", "MonsterField", pMonsterPos, (self.__cardWidth, self.__cardHeight), (255,255,255)))
|
|
self.__boardFields.append(BoardField("PlayerEffectField-"+str(i), "Player", "EffectField", pEffectPos, (self.__cardWidth, self.__cardHeight), (255,255,255)))
|
|
self.__boardFields.append(BoardField("EnemyMonsterField-"+str(i), "Enemy", "MonsterField", eMonsterPos, (self.__cardWidth, self.__cardHeight), (255,255,255)))
|
|
self.__boardFields.append(BoardField("EnemySpellTrapField-"+str(i), "Enemy", "EffectField", eEffectPos, (self.__cardWidth, self.__cardHeight), (255,255,255)))
|
|
pass
|
|
def getBoardFields(self) -> list:
|
|
return self.__boardFields
|
|
|
|
def getCardWidth(self) -> int:
|
|
return self.__cardWidth
|
|
|
|
def getCardHeight(self) -> int:
|
|
return self.__cardHeight |