simplyfied y world positioning
This commit is contained in:
@ -3,11 +3,11 @@ from Classes.Objects.BoardField import BoardField
|
||||
|
||||
class World():
|
||||
__boardFields:list
|
||||
__cardWidth:int = 200
|
||||
__cardHeight:int = 250
|
||||
__cardWidth:int = 150
|
||||
__cardHeight:int = 200
|
||||
__cardOffset:int = 400
|
||||
|
||||
def __init__(self, cardWidth:int=200, cardHeight:int=250, cardOffset:int=400):
|
||||
def __init__(self, cardWidth:int=150, cardHeight:int=200, cardOffset:int=400):
|
||||
self.__boardFields = []
|
||||
self.__cardWidth = cardWidth
|
||||
self.__cardHeight = cardHeight
|
||||
@ -18,31 +18,33 @@ class World():
|
||||
# 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", "Enemy", "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", "Enemy", "Grave", pVector, (self.__cardWidth, self.__cardHeight), (0,255,0)))
|
||||
pRow1Height = ((2 * self.__cardHeight) + 60)
|
||||
pRow2Height = ((2 * self.__cardHeight) + self.__cardHeight + 70)
|
||||
eRow1Height = 15
|
||||
eRow2Height = (self.__cardHeight + 25)
|
||||
|
||||
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 5)), ((2 * self.__cardHeight) + 60))
|
||||
self.__boardFields.append(BoardField("PlayerDeck", "Player", "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", "Player", "Grave", pVector, (self.__cardWidth, self.__cardHeight), (255,0,0)))
|
||||
|
||||
eDeckPos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 0)), 15)
|
||||
eGravePos = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * 0)), (self.__cardHeight + 25))
|
||||
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):
|
||||
pVector = pygame.Vector2((self.__cardOffset + ((self.__cardWidth + 10) * i)), ((2 * self.__cardHeight) + 60))
|
||||
self.__boardFields.append(BoardField("PlayerMonsterField-"+str(i), "Player", "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), "Player", "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), "Enemy", "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), "Enemy", "EffectField", pVector, (self.__cardWidth, self.__cardHeight), (255,255,255)))
|
||||
|
||||
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
|
||||
|
||||
|
Binary file not shown.
@ -33,7 +33,7 @@ class App:
|
||||
# create sprite groups
|
||||
self.cards = pygame.sprite.Group()
|
||||
|
||||
testMonsterCard = MonsterCard(pygame.Vector2(500,500), "Assets/Cards/MonsterCards/testmonstercard/", self.__inputHandler)
|
||||
testMonsterCard = MonsterCard(pygame.Vector2(500, 850), "Assets/Cards/MonsterCards/testmonstercard/", self.__inputHandler)
|
||||
self.cards.add(testMonsterCard)
|
||||
|
||||
while self.__running:
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user