dashcode 1.0.4__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dashcode-1.0.4 → dashcode-1.1.0}/PKG-INFO +1 -1
- {dashcode-1.0.4 → dashcode-1.1.0}/dashcode/core.py +37 -2
- {dashcode-1.0.4 → dashcode-1.1.0}/dashcode.egg-info/PKG-INFO +1 -1
- {dashcode-1.0.4 → dashcode-1.1.0}/setup.py +1 -1
- {dashcode-1.0.4 → dashcode-1.1.0}/README.md +0 -0
- {dashcode-1.0.4 → dashcode-1.1.0}/dashcode/__init__.py +0 -0
- {dashcode-1.0.4 → dashcode-1.1.0}/dashcode.egg-info/SOURCES.txt +0 -0
- {dashcode-1.0.4 → dashcode-1.1.0}/dashcode.egg-info/dependency_links.txt +0 -0
- {dashcode-1.0.4 → dashcode-1.1.0}/dashcode.egg-info/top_level.txt +0 -0
- {dashcode-1.0.4 → dashcode-1.1.0}/setup.cfg +0 -0
|
@@ -12,12 +12,12 @@ class Dashcode:
|
|
|
12
12
|
global objects
|
|
13
13
|
self.params = {
|
|
14
14
|
"NoTouch": 13,
|
|
15
|
-
"Hide":
|
|
15
|
+
"Hide": 12,
|
|
16
16
|
"Group": 57,
|
|
17
17
|
"TGroup": 51,
|
|
18
18
|
"Duration": 10,
|
|
19
19
|
"Alpha": 11,
|
|
20
|
-
"TouchTrigger": 11,
|
|
20
|
+
"TouchTrigger": 11,
|
|
21
21
|
"ActivateGroup": 56,
|
|
22
22
|
"ScaleX": 128,
|
|
23
23
|
"ScaleY": 129,
|
|
@@ -37,6 +37,11 @@ class Dashcode:
|
|
|
37
37
|
"p_cube": 12, "p_ship": 13, "p_ball": 47, "p_ufo": 111,
|
|
38
38
|
"p_wave": 660, "p_robot": 745, "p_spider": 1331, "p_swing": 1933
|
|
39
39
|
}
|
|
40
|
+
self.prefabs = {
|
|
41
|
+
"wall": {"Y":0},
|
|
42
|
+
"platform": {"X":0},
|
|
43
|
+
"square": {"X":0, "Y":0},
|
|
44
|
+
}
|
|
40
45
|
|
|
41
46
|
def setobjects(self, objs:dict):
|
|
42
47
|
self.objects = objs
|
|
@@ -45,6 +50,9 @@ class Dashcode:
|
|
|
45
50
|
self.params = params
|
|
46
51
|
|
|
47
52
|
def addobject(self, obj: str, params: dict):
|
|
53
|
+
if len(objects) <= 0:
|
|
54
|
+
objects.append(
|
|
55
|
+
f"1,1,2,{str(-10 * 30)},3,{str(-10 * 30)},12,1,13,1")
|
|
48
56
|
extraparams = ""
|
|
49
57
|
for param, value in params.items():
|
|
50
58
|
if self.params.get(param) is not None:
|
|
@@ -61,6 +69,33 @@ class Dashcode:
|
|
|
61
69
|
objects.append(
|
|
62
70
|
f"1,{str(obj)},2,{str(params.get('X') * 30 + 15)},3,{str(params.get('Y') * 30 + 15)}{extraparams}")
|
|
63
71
|
|
|
72
|
+
def addprefab(self, obj:str, params:dict, prefab:str):
|
|
73
|
+
extraparams = ""
|
|
74
|
+
for param, value in params.items():
|
|
75
|
+
if self.params.get(param) is not None:
|
|
76
|
+
pid = self.params[param]
|
|
77
|
+
extraparams += f",{str(pid)},{value}"
|
|
78
|
+
else:
|
|
79
|
+
extraparams += f",{str(param)},{value}"
|
|
80
|
+
|
|
81
|
+
oid = self.objects.get(obj, 1)
|
|
82
|
+
if prefab:
|
|
83
|
+
#print("1")
|
|
84
|
+
fab = self.prefabs.get(prefab)
|
|
85
|
+
if fab:
|
|
86
|
+
#print(fab)
|
|
87
|
+
#print("2")
|
|
88
|
+
if fab.get("X") == 0:
|
|
89
|
+
#print("3")
|
|
90
|
+
for i in range(params.get('EX')):
|
|
91
|
+
objects.append(
|
|
92
|
+
f"1,{str(oid)},2,{str(params.get('X') * 30 + 15 + (i * 30))},3,{str(params.get('Y') * 30 + 15)}{extraparams}")
|
|
93
|
+
if fab.get("Y") == 0:
|
|
94
|
+
#print("3")
|
|
95
|
+
for i in range(params.get('EY')):
|
|
96
|
+
objects.append(
|
|
97
|
+
f"1,{str(oid)},2,{str(params.get('X') * 30 + 15)},3,{str(params.get('Y') * 30 + 15 + (i * 30))}{extraparams}")
|
|
98
|
+
|
|
64
99
|
def create_gmd_file(self, level_name, author_name, objects_string):
|
|
65
100
|
global lvlname
|
|
66
101
|
lvlname = level_name
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|