successfully added card snapping
This commit is contained in:
@ -13,6 +13,7 @@ class MonsterCard(pygame.sprite.Sprite):
|
||||
__dragging:bool = False
|
||||
__offset:pygame.Vector2 = pygame.Vector2(0,0)
|
||||
__inputHandler: InputHandler
|
||||
__type:str = "MonsterCard"
|
||||
image:pygame.image
|
||||
rect:pygame.rect
|
||||
|
||||
@ -37,8 +38,6 @@ class MonsterCard(pygame.sprite.Sprite):
|
||||
self.__attacks.append(attack)
|
||||
|
||||
def update(self):
|
||||
print("card update")
|
||||
print(self.getDragging())
|
||||
if self.getDragging():
|
||||
mouse_pos = self.__inputHandler.getMousePos()
|
||||
self.__pos = mouse_pos
|
||||
@ -65,8 +64,14 @@ class MonsterCard(pygame.sprite.Sprite):
|
||||
def getPos(self):
|
||||
return self.__pos
|
||||
|
||||
def getType(self):
|
||||
return self.__type
|
||||
|
||||
def setDragging(self, dragging:bool):
|
||||
self.__dragging = dragging
|
||||
|
||||
def setOffset(self, offset:pygame.Vector2):
|
||||
self.__offset = offset
|
||||
self.__offset = offset
|
||||
|
||||
def setPos(self, pos:pygame.Vector2):
|
||||
self.__pos = pos
|
Binary file not shown.
Reference in New Issue
Block a user