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 = 200
|
|
__cardHeight:int = 250
|
|
__cardOffset:int = 400
|
|
|
|
def __init__(self, cardWidth:int=200, cardHeight:int=250, cardOffset:int=400):
|
|
self.__boardFields = []
|
|
self.__cardWidth = cardWidth
|
|
self.__cardHeight = cardHeight
|
|
self.__cardOffset = cardOffset
|
|
self.buildGameWorld()
|
|
|
|
def buildGameWorld(self):
|
|
# TODO: rebuild these to use the BoardField Class and to append them to the __boardFields list
|
|
# construct elements arround the playerfield
|
|
# Todo add lifepoint label for player and enemy and make them scriptable
|
|
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 0)), 15)
|
|
self.__boardFields.append(BoardField("EnemyDeck", "Deck", pVector, (self.__cardWidth, self.__cardHeight), (0,255,0)))
|
|
|
|
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 0)), (self.__cardHeight + 25))
|
|
self.__boardFields.append(BoardField("EnemyGraveyard", "Grave", pVector, (self.__cardWidth, self.__cardHeight), (0,255,0)))
|
|
|
|
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 5)), ((2 * self.__cardHeight) + 60))
|
|
self.__boardFields.append(BoardField("PlayerDeck", "Deck", pVector, (self.__cardWidth, self.__cardHeight), (255,0,0)))
|
|
|
|
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 5)), ((2 * self.__cardHeight) + self.__cardHeight + 70))
|
|
self.__boardFields.append(BoardField("PlayerGraveyard", "Grave", pVector, (self.__cardWidth, self.__cardHeight), (255,0,0)))
|
|
|
|
for i in range(5):
|
|
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * i)), ((2 * self.__cardHeight) + 60))
|
|
self.__boardFields.append(BoardField("PlayerMonsterField-"+str(i),"MonsterField",pVector,(self.__cardWidth, self.__cardHeight),(255,255,255)))
|
|
|
|
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * i)), ((2 * self.__cardHeight) + self.__cardHeight + 70))
|
|
self.__boardFields.append(BoardField("PlayerMonsterField-"+str(i), "EffectField", pVector, (self.__cardWidth, self.__cardHeight), (255,255,255)))
|
|
|
|
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * (i+1)), 15), (self.__cardWidth, self.__cardHeight))
|
|
self.__boardFields.append(BoardField("EnemyMonsterField-"+str(i), "MonsterField", pVector, (self.__cardWidth, self.__cardHeight), (255,255,255)))
|
|
|
|
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * (i+1))), (self.__cardHeight + 25))
|
|
self.__boardFields.append(BoardField("EnemySpellTrapField-"+str(i), "EffectField", pVector, (self.__cardWidth, self.__cardHeight), (255,255,255)))
|
|
|
|
def getBoardFields(self) -> list:
|
|
return self.__boardFields
|
|
|
|
def getCardWidth(self) -> int:
|
|
return self.__cardWidth
|
|
|
|
def getCardHeight(self) -> int:
|
|
return self.__cardHeight |