-
Notifications
You must be signed in to change notification settings - Fork 7
/
target.py
40 lines (34 loc) · 1.1 KB
/
target.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
"""
Target (sprite) class
======= CLASS INFO =======
The various files with classes are used by s2p_unpacker and the correct data is
set. Those are then used to build the project in main.py.
"""
class Target:
def __init__(self):
self.isStage = False
self.variables = {}
self.lists = {}
self.blocks = {}
self.currentCostume = 0
self.costumes = []
self.sounds = []
self.volume = 100
self.layerOrder = 1 # 0 is only for the bg image, lower value = background position
self.visible = True
self.x = 0
self.y = 0
self.size = 100
self.direction = 90
self.draggable = False
self.rotationStyle = "all around" # all around, left-right or do not rotate
self.sprite = None
self.name = ""
# Variable functions
def getVariableValue(self, varId):
return self.variables[varId][1]
def getVariableName(self, varId):
return self.variables[varId][0]
def setVariableValue(self, varId, newValue):
self.variables[varId][1] = newValue
return newValue