forked from KevinFrazier/CitrusHack2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTile.py
54 lines (38 loc) · 1.36 KB
/
Tile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import pygame
class Tile:
def __init__(self, h, w, bg, chara, posX, posY, move):
self.height = h
self.width = w
# background image (string of image in directory)
self.background = bg
# self.changeBackground(self.background)
# character object
self.character = chara
self.posX = posX
self.posY = posY
self.move = move
self.isfilled = False
self.highlighted = False
def changeHighlighted(self, BOOL):
self.highlighted = BOOL
def isHighlighted(self):
return self.highlighted
def changeBackground(self, background):
self.background = pygame.image.load(background)
'''
need to skew
'''
self.background = pygame.transform.rotate(self.background,30)
self.background = pygame.transform.scale(self.background, (self.width, self.height))
def changeCharacter(self, character):
self.character = character
if character is 0:
return
else:
self.character.image = pygame.transform.scale(self.character.image, (self.width, self.height))
def changeMove(self, move):
self.move = move
def isFilled(self):
return self.isfilled
def getPosition(self):
return (self.posX,self.posY)