Browse Source

first working config

shuvit 5 years ago
parent
commit
284971e783
2 changed files with 257 additions and 205 deletions
  1. 256
    205
      Settings.py
  2. 1
    0
      walk.py

+ 256
- 205
Settings.py View File

@@ -1,221 +1,272 @@
1 1
 #from bge import logic
2
+import bge
2 3
 import GameLogic
4
+import configobj
5
+from configobj import ConfigObj
6
+
3 7
 #from os.path import dirname, realpath, join
4 8
 
5 9
 #BASE_DIR = os.path.join( os.path.dirname( __file__ ), '..' )
6 10
 mainDir = GameLogic.expandPath("//")
7 11
 
8
-fileName = mainDir + "Settings.dat"
9
-resx = 1280
10
-resy = 720
12
+fileName = mainDir + "config.ini"
13
+
14
+config = ConfigObj(fileName, interpolation=True)
15
+#config.filename = filename
16
+dict = bge.logic.globalDict
17
+
18
+#resx = 1280
19
+#resy = 720
20
+print('###############start game##########')
21
+dict['music_player'] = 1
22
+def to_dict(section, key):
23
+    dict = bge.logic.globalDict
24
+    #print(key, config[key])
25
+    str = config[key]
26
+    if str.isdigit():
27
+        dict[key] = int(str)
28
+    else:
29
+        try:
30
+            dict[key] = float(str)
31
+        except:
32
+            dict[key] = str   
33
+
34
+
11 35
 def readSettings():
12
-    import GameLogic
13
-    import bge
14
-    cont = GameLogic.getCurrentController()
15
-    own = cont.owner
16
-    scenes = bge.logic.getSceneList()
17
-    main_scene = [scene for scene in scenes if scene.name=="main"][0]
18
-    own = main_scene.objects['Empty']
36
+    config.walk(to_dict)    
19 37
     
20
-    with open(fileName) as reading:
21
-        #data = [line.split()[0] for line in reading]
22
-        data = reading.readlines()
23
-        #print lines[25]
24
-        #print lines[29]
25
-        reading.close()
26
-
27
-    #own["val"] = int(data[1])
28
-    #own["bright"] = int(data[1])
29
-    own["playerName"] = data[4]
30
-    #own["audio"] = int(data[3])
31
-    own["level"] = data[5]
32
-    #data6 = data[6]
33
-    #data6.split(None, 1)[0]
34
-    #data5 = data5.strip('\n')
35
-    #print(data6)
36
-    own["resx"] = int(data[7])
37
-    own["resy"] = int(data[8])
38
-    own["framerate"] = int(data[10])
39
-    own["profile"] = int(data[12])
40
-    dict = bge.logic.globalDict #Get the global dictionary
41 38
     
42
-    dict['resx'] = own["resx"]
43
-    dict['resy'] = own["resy"]   
44
-    level = data[5]
45
-    level = level.split(None, 1)[0]
46
-    level = str(level)
47
-    own["level"] = level
48
-    dict["level"] = level
49
-    print("reading. settings")
50
-    print("Level: ", level)
51
-    recorder_on = int(data[14])
52
-    print("Game play recorder on: ", recorder_on) 
53
-    #dict = bge.logic.globalDict
54
-    dict['recorder_on'] = recorder_on
55
-    own['recorder_on'] = recorder_on
56
-    dict['recorder_on'] = recorder_on 
57
-    character = data[1]
58
-    dict["character"] = str(character.split(None, 1)[0])
59
-    dict["shirt_color_r"] = float(data[16])
60
-    dict["shirt_color_g"] = float(data[17])
61
-    dict["shirt_color_b"] = float(data[18])
62
-    dict["shoe_color_r"] = float(data[20])
63
-    dict["shoe_color_g"] = float(data[21])
64
-    dict["shoe_color_b"] = float(data[22]) 
65
-    dict["deck_color_r"] = float(data[24])
66
-    dict["deck_color_g"] = float(data[25])
67
-    dict["deck_color_b"] = float(data[26]) 
68
-    dict["shirt_logo"] = int(data[28])  
69
-    dict["bc"] = int(data[30])
70
-    dict["BC_BRIGHTNESS"] = float(data[31])
71
-    dict["BC_CONTRAST"] = float(data[32])  
72
-    dict['hdr'] = int(data[34])
73
-    dict['avgL'] = float(data[35])
74
-    dict['HDRamount'] = float(data[36])
75
-    dict['ao'] = int(data[38])
76
-    dict['onlyAO'] = int(data[39])
77
-    dict['aowidth'] = float(data[40])
78
-    dict['aoradius'] = float(data[41])
79
-    dict['dof_on'] = float(data[43])
80
-    dict['sun_strength'] = float(data[45])
81
-    dict['sun_rot_x'] = float(data[46])
82
-    dict['sun_rot_y'] = float(data[47])            
83
-    dict['shadow_on'] = int(data[48])
84
-    dict['ambient_strength'] = float(data[49]) 
85
-    dict['fullscreen_on'] = int(data[51]) 
86
-    dict['bloom_on'] = int(data[53]) 
87
-    dict['cam_height'] = float(data[55]) 
88
-    dict['focal_length'] = int(data[56])        
89
-    dict['cam_min'] = float(data[57])
90
-    dict['cam_max'] = float(data[58])
91
-    dict['music_player'] = int(data[60]) 
92
-    dict['fxaa'] = int(data[62]) 
93
-    dict['FXAA_SPAN_MAX'] = float(data[63])   
94
-    dict['cch_targetHeight'] = float(data[65])         
95
-    dict["trucks_r"] = float(data[67])
96
-    dict["trucks_g"] = float(data[68])
97
-    dict["trucks_b"] = float(data[69])
98
-    dict["wheel1_r"] = float(data[71])
99
-    dict["wheel1_g"] = float(data[72])
100
-    dict["wheel1_b"] = float(data[73])
101
-    dict["wheel2_r"] = float(data[75])
102
-    dict["wheel2_g"] = float(data[76])
103
-    dict["wheel2_b"] = float(data[77])
104
-    dict["wheel3_r"] = float(data[79])
105
-    dict["wheel3_g"] = float(data[80])
106
-    dict["wheel3_b"] = float(data[81])
107
-    dict["wheel4_r"] = float(data[83])
108
-    dict["wheel4_g"] = float(data[84])
109
-    dict["wheel4_b"] = float(data[85])  
110
-    dict["deck_index"] = int(data[87])                        
111 39
     
40
+    
41
+    
42
+#    import GameLogic
43
+#    import bge
44
+#    cont = GameLogic.getCurrentController()
45
+#    own = cont.owner
46
+#    scenes = bge.logic.getSceneList()
47
+#    main_scene = [scene for scene in scenes if scene.name=="main"][0]
48
+#    own = main_scene.objects['Empty']
49
+#    
50
+#    with open(fileName) as reading:
51
+#        #data = [line.split()[0] for line in reading]
52
+#        data = reading.readlines()
53
+#        #print lines[25]
54
+#        #print lines[29]
55
+#        reading.close()
56
+
57
+#    #own["val"] = int(data[1])
58
+#    #own["bright"] = int(data[1])
59
+#    own["playerName"] = data[4]
60
+#    #own["audio"] = int(data[3])
61
+#    own["level"] = data[5]
62
+#    #data6 = data[6]
63
+#    #data6.split(None, 1)[0]
64
+#    #data5 = data5.strip('\n')
65
+#    #print(data6)
66
+#    own["resx"] = int(data[7])
67
+#    own["resy"] = int(data[8])
68
+#    own["framerate"] = int(data[10])
69
+#    own["profile"] = int(data[12])
70
+#    dict = bge.logic.globalDict #Get the global dictionary
71
+#    
72
+#    dict['resx'] = own["resx"]
73
+#    dict['resy'] = own["resy"]   
74
+#    level = data[5]
75
+#    level = level.split(None, 1)[0]
76
+#    level = str(level)
77
+#    own["level"] = level
78
+#    dict["level"] = level
79
+#    print("reading. settings")
80
+#    
81
+#    
82
+#    
83
+#    
84
+#    
85
+#    
86
+#    
87
+#    
88
+#    
89
+#    print("Level: ", level)
90
+#    recorder_on = int(data[14])
91
+#    print("Game play recorder on: ", recorder_on) 
92
+#    #dict = bge.logic.globalDict
93
+#    dict['recorder_on'] = recorder_on
94
+#    own['recorder_on'] = recorder_on
95
+#    dict['recorder_on'] = recorder_on 
96
+#    character = data[1]
97
+#    dict["character"] = str(character.split(None, 1)[0])
98
+#    dict["shirt_color_r"] = float(data[16])
99
+#    dict["shirt_color_g"] = float(data[17])
100
+#    dict["shirt_color_b"] = float(data[18])
101
+#    dict["shoe_color_r"] = float(data[20])
102
+#    dict["shoe_color_g"] = float(data[21])
103
+#    dict["shoe_color_b"] = float(data[22]) 
104
+#    dict["deck_color_r"] = float(data[24])
105
+#    dict["deck_color_g"] = float(data[25])
106
+#    dict["deck_color_b"] = float(data[26]) 
107
+#    dict["shirt_logo"] = int(data[28])  
108
+#    dict["bc"] = int(data[30])
109
+#    dict["BC_BRIGHTNESS"] = float(data[31])
110
+#    dict["BC_CONTRAST"] = float(data[32])  
111
+#    dict['hdr'] = int(data[34])
112
+#    dict['avgL'] = float(data[35])
113
+#    dict['HDRamount'] = float(data[36])
114
+#    dict['ao'] = int(data[38])
115
+#    dict['onlyAO'] = int(data[39])
116
+#    dict['aowidth'] = float(data[40])
117
+#    dict['aoradius'] = float(data[41])
118
+#    dict['dof_on'] = float(data[43])
119
+#    dict['sun_strength'] = float(data[45])
120
+#    dict['sun_rot_x'] = float(data[46])
121
+#    dict['sun_rot_y'] = float(data[47])            
122
+#    dict['shadow_on'] = int(data[48])
123
+#    dict['ambient_strength'] = float(data[49]) 
124
+#    dict['fullscreen_on'] = int(data[51]) 
125
+#    dict['bloom_on'] = int(data[53]) 
126
+#    dict['cam_height'] = float(data[55]) 
127
+#    dict['focal_length'] = int(data[56])        
128
+#    dict['cam_min'] = float(data[57])
129
+#    dict['cam_max'] = float(data[58])
130
+#    dict['music_player'] = int(data[60]) 
131
+#    dict['fxaa'] = int(data[62]) 
132
+#    dict['FXAA_SPAN_MAX'] = float(data[63])   
133
+#    dict['cch_targetHeight'] = float(data[65])         
134
+#    dict["trucks_r"] = float(data[67])
135
+#    dict["trucks_g"] = float(data[68])
136
+#    dict["trucks_b"] = float(data[69])
137
+#    dict["wheel1_r"] = float(data[71])
138
+#    dict["wheel1_g"] = float(data[72])
139
+#    dict["wheel1_b"] = float(data[73])
140
+#    dict["wheel2_r"] = float(data[75])
141
+#    dict["wheel2_g"] = float(data[76])
142
+#    dict["wheel2_b"] = float(data[77])
143
+#    dict["wheel3_r"] = float(data[79])
144
+#    dict["wheel3_g"] = float(data[80])
145
+#    dict["wheel3_b"] = float(data[81])
146
+#    dict["wheel4_r"] = float(data[83])
147
+#    dict["wheel4_g"] = float(data[84])
148
+#    dict["wheel4_b"] = float(data[85])  
149
+#    dict["deck_index"] = int(data[87])                        
150
+#    
112 151
     #print('bc = ', dict['bc'])        
113 152
     #dict['music_player_on'] = int(data[16])  
153
+
154
+def from_dict(section, key):
155
+    
156
+    config[key] = dict[key]
157
+
114 158
 def writeSettings():
115
-    import GameLogic
116
-    import bge
117
-    cont = GameLogic.getCurrentController()
118
-    own = cont.owner
119
-    scenes = bge.logic.getSceneList()
120
-    dict = bge.logic.globalDict
121
-    main_scene = [scene for scene in scenes if scene.name=="main"][0]
122
-    own = main_scene.objects['Empty']
123
-    print("writing called")
124
-    with open(fileName, 'w') as writing:
125
-        writing.write(str("//settings.dat")+"\n")
126
-        writing.write(str(dict["character"])+"\n")
127
-        writing.write(str(own["bright"])+"\n")
128
-        writing.write(str("-\n"))
129
-        writing.write(str("//level (e.g. spine, city, city2)")+"\n")
130
-        writing.write(str(own["level"])+"\n")
131
-        writing.write(str("//resolution")+"\n")
132
-        writing.write(str(dict["resx"])+"\n")
133
-        writing.write(str(dict["resy"])+"\n")
134
-        writing.write(str("//show framerate")+"\n")
135
-        writing.write(str(own["framerate"])+"\n")
136
-        writing.write(str("//show profile")+"\n")
137
-        writing.write(str(own["profile"])+"\n")
138
-        writing.write(str("//Game play recorder off/on (0,1)")+"\n")
139
-        writing.write(str(own["recorder_on"])+"\n")
140
-        writing.write(str("//Shirt color [r,g,b]")+"\n")
141
-        writing.write(str(dict["shirt_color_r"])+"\n") #16
142
-        writing.write(str(dict["shirt_color_g"])+"\n")
143
-        writing.write(str(dict["shirt_color_b"])+"\n")    # 
144
-        writing.write(str("//Shoe color [r,g,b]")+"\n")
145
-        writing.write(str(dict["shoe_color_r"])+"\n") #16
146
-        writing.write(str(dict["shoe_color_g"])+"\n")
147
-        writing.write(str(dict["shoe_color_b"])+"\n")    # 
148
-        writing.write(str("//Deck color [r,g,b]")+"\n")
149
-        writing.write(str(dict["deck_color_r"])+"\n") #24
150
-        writing.write(str(dict["deck_color_g"])+"\n")
151
-        writing.write(str(dict["deck_color_b"])+"\n")    #                           
152
-        writing.write(str("//Shirt Logo")+"\n")
153
-        writing.write(str(dict["shirt_logo"])+"\n") #24
154
-        writing.write(str("//Brightness/Contrast: On, brightness, contrast")+"\n")
155
-        writing.write(str(dict["bc"])+"\n")
156
-        writing.write(str(dict["BC_BRIGHTNESS"])+"\n")
157
-        writing.write(str(dict["BC_CONTRAST"])+"\n")
158
-        writing.write(str("//HDR: On, avgL, amount")+"\n")
159
-        writing.write(str(dict["hdr"])+"\n")
160
-        writing.write(str(dict["avgL"])+"\n")
161
-        writing.write(str(dict["HDRamount"])+"\n") 
162
-        writing.write(str("//AO: On, only, width, radius")+"\n")
163
-        writing.write(str(dict["ao"])+"\n")
164
-        writing.write(str(dict["onlyAO"])+"\n")
165
-        writing.write(str(dict["aowidth"])+"\n")                
166
-        writing.write(str(dict["aoradius"])+"\n") 
167
-        writing.write(str("//dof on")+"\n")
168
-        writing.write(str(dict["dof_on"])+"\n") 
169
-        writing.write(str("//sun settings: strength, rotx, roty, shadow on, ambient strength")+"\n")
170
-        writing.write(str(dict["sun_strength"])+"\n")                           
171
-        writing.write(str(dict["sun_rot_x"])+"\n")                           
172
-        writing.write(str(dict["sun_rot_y"])+"\n")                           
173
-        writing.write(str(dict["shadow_on"])+"\n")                                     
174
-        writing.write(str(dict["ambient_strength"])+"\n") 
175
-        writing.write(str("//fullscreen on (0,1)")+"\n")
176
-        writing.write(str(dict["fullscreen_on"])+"\n") 
177
-        writing.write(str("//bloom on (0,1)")+"\n")
178
-        writing.write(str(dict["bloom_on"])+"\n")  
179
-        writing.write(str("//cam")+"\n")
180
-        writing.write(str(dict["cam_height"])+"\n") 
181
-        writing.write(str(dict["focal_length"])+"\n") 
182
-        writing.write(str(dict["cam_min"])+"\n")                 
183
-        writing.write(str(dict["cam_max"])+"\n") 
184
-        writing.write(str("//music player on / off")+"\n")
185
-        writing.write(str(dict["music_player"])+"\n")
186
-        writing.write(str("//fxaa")+"\n")
187
-        writing.write(str(dict["fxaa"])+"\n") 
188
-        writing.write(str(dict["FXAA_SPAN_MAX"])+"\n")    
189
-        writing.write(str("//camera target height")+"\n")
190
-        writing.write(str(dict["cch_targetHeight"] )+"\n")   
191
-        writing.write(str("//trucks color [r,g,b]")+"\n")
192
-        writing.write(str(dict["trucks_r"])+"\n")
193
-        writing.write(str(dict["trucks_g"])+"\n")
194
-        writing.write(str(dict["trucks_b"])+"\n") 
195
-        writing.write(str("//wheel1 color [r,g,b]")+"\n")
196
-        writing.write(str(dict["wheel1_r"])+"\n")
197
-        writing.write(str(dict["wheel1_g"])+"\n")
198
-        writing.write(str(dict["wheel1_b"])+"\n") 
199
-        writing.write(str("//wheel2 color [r,g,b]")+"\n")
200
-        writing.write(str(dict["wheel2_r"])+"\n")
201
-        writing.write(str(dict["wheel2_g"])+"\n")
202
-        writing.write(str(dict["wheel2_b"])+"\n") 
203
-        writing.write(str("//wheel3 color [r,g,b]")+"\n")
204
-        writing.write(str(dict["wheel3_r"])+"\n")
205
-        writing.write(str(dict["wheel3_g"])+"\n")
206
-        writing.write(str(dict["wheel3_b"])+"\n") 
207
-        writing.write(str("//wheel4 color [r,g,b]")+"\n")
208
-        writing.write(str(dict["wheel4_r"])+"\n")
209
-        writing.write(str(dict["wheel4_g"])+"\n")
210
-        writing.write(str(dict["wheel4_b"])+"\n")                                          
211
-        writing.write(str("//deck index")+"\n")
212
-        writing.write(str(dict["deck_index"])+"\n")        
213
-        
214
-        #dict['ccH_targetHeight']     
159
+    config.walk(from_dict)  
160
+    config.write()    
161
+    
162
+          
215 163
         
216
-        #writing.write(str(own["framerate"])+"\n")
217
-        print("writing settings")
218
-        writing.close()
164
+    
165
+    
166
+#    import GameLogic
167
+#    import bge
168
+#    cont = GameLogic.getCurrentController()
169
+#    own = cont.owner
170
+#    scenes = bge.logic.getSceneList()
171
+#    dict = bge.logic.globalDict
172
+#    main_scene = [scene for scene in scenes if scene.name=="main"][0]
173
+#    own = main_scene.objects['Empty']
174
+#    print("writing called")
175
+#    with open(fileName, 'w') as writing:
176
+#        writing.write(str("//settings.dat")+"\n")
177
+#        writing.write(str(dict["character"])+"\n")
178
+#        writing.write(str(own["bright"])+"\n")
179
+#        writing.write(str("-\n"))
180
+#        writing.write(str("//level (e.g. spine, city, city2)")+"\n")
181
+#        writing.write(str(own["level"])+"\n")
182
+#        writing.write(str("//resolution")+"\n")
183
+#        writing.write(str(dict["resx"])+"\n")
184
+#        writing.write(str(dict["resy"])+"\n")
185
+#        writing.write(str("//show framerate")+"\n")
186
+#        writing.write(str(own["framerate"])+"\n")
187
+#        writing.write(str("//show profile")+"\n")
188
+#        writing.write(str(own["profile"])+"\n")
189
+#        writing.write(str("//Game play recorder off/on (0,1)")+"\n")
190
+#        writing.write(str(own["recorder_on"])+"\n")
191
+#        writing.write(str("//Shirt color [r,g,b]")+"\n")
192
+#        writing.write(str(dict["shirt_color_r"])+"\n") #16
193
+#        writing.write(str(dict["shirt_color_g"])+"\n")
194
+#        writing.write(str(dict["shirt_color_b"])+"\n")    # 
195
+#        writing.write(str("//Shoe color [r,g,b]")+"\n")
196
+#        writing.write(str(dict["shoe_color_r"])+"\n") #16
197
+#        writing.write(str(dict["shoe_color_g"])+"\n")
198
+#        writing.write(str(dict["shoe_color_b"])+"\n")    # 
199
+#        writing.write(str("//Deck color [r,g,b]")+"\n")
200
+#        writing.write(str(dict["deck_color_r"])+"\n") #24
201
+#        writing.write(str(dict["deck_color_g"])+"\n")
202
+#        writing.write(str(dict["deck_color_b"])+"\n")    #                           
203
+#        writing.write(str("//Shirt Logo")+"\n")
204
+#        writing.write(str(dict["shirt_logo"])+"\n") #24
205
+#        writing.write(str("//Brightness/Contrast: On, brightness, contrast")+"\n")
206
+#        writing.write(str(dict["bc"])+"\n")
207
+#        writing.write(str(dict["BC_BRIGHTNESS"])+"\n")
208
+#        writing.write(str(dict["BC_CONTRAST"])+"\n")
209
+#        writing.write(str("//HDR: On, avgL, amount")+"\n")
210
+#        writing.write(str(dict["hdr"])+"\n")
211
+#        writing.write(str(dict["avgL"])+"\n")
212
+#        writing.write(str(dict["HDRamount"])+"\n") 
213
+#        writing.write(str("//AO: On, only, width, radius")+"\n")
214
+#        writing.write(str(dict["ao"])+"\n")
215
+#        writing.write(str(dict["onlyAO"])+"\n")
216
+#        writing.write(str(dict["aowidth"])+"\n")                
217
+#        writing.write(str(dict["aoradius"])+"\n") 
218
+#        writing.write(str("//dof on")+"\n")
219
+#        writing.write(str(dict["dof_on"])+"\n") 
220
+#        writing.write(str("//sun settings: strength, rotx, roty, shadow on, ambient strength")+"\n")
221
+#        writing.write(str(dict["sun_strength"])+"\n")                           
222
+#        writing.write(str(dict["sun_rot_x"])+"\n")                           
223
+#        writing.write(str(dict["sun_rot_y"])+"\n")                           
224
+#        writing.write(str(dict["shadow_on"])+"\n")                                     
225
+#        writing.write(str(dict["ambient_strength"])+"\n") 
226
+#        writing.write(str("//fullscreen on (0,1)")+"\n")
227
+#        writing.write(str(dict["fullscreen_on"])+"\n") 
228
+#        writing.write(str("//bloom on (0,1)")+"\n")
229
+#        writing.write(str(dict["bloom_on"])+"\n")  
230
+#        writing.write(str("//cam")+"\n")
231
+#        writing.write(str(dict["cam_height"])+"\n") 
232
+#        writing.write(str(dict["focal_length"])+"\n") 
233
+#        writing.write(str(dict["cam_min"])+"\n")                 
234
+#        writing.write(str(dict["cam_max"])+"\n") 
235
+#        writing.write(str("//music player on / off")+"\n")
236
+#        writing.write(str(dict["music_player"])+"\n")
237
+#        writing.write(str("//fxaa")+"\n")
238
+#        writing.write(str(dict["fxaa"])+"\n") 
239
+#        writing.write(str(dict["FXAA_SPAN_MAX"])+"\n")    
240
+#        writing.write(str("//camera target height")+"\n")
241
+#        writing.write(str(dict["cch_targetHeight"] )+"\n")   
242
+#        writing.write(str("//trucks color [r,g,b]")+"\n")
243
+#        writing.write(str(dict["trucks_r"])+"\n")
244
+#        writing.write(str(dict["trucks_g"])+"\n")
245
+#        writing.write(str(dict["trucks_b"])+"\n") 
246
+#        writing.write(str("//wheel1 color [r,g,b]")+"\n")
247
+#        writing.write(str(dict["wheel1_r"])+"\n")
248
+#        writing.write(str(dict["wheel1_g"])+"\n")
249
+#        writing.write(str(dict["wheel1_b"])+"\n") 
250
+#        writing.write(str("//wheel2 color [r,g,b]")+"\n")
251
+#        writing.write(str(dict["wheel2_r"])+"\n")
252
+#        writing.write(str(dict["wheel2_g"])+"\n")
253
+#        writing.write(str(dict["wheel2_b"])+"\n") 
254
+#        writing.write(str("//wheel3 color [r,g,b]")+"\n")
255
+#        writing.write(str(dict["wheel3_r"])+"\n")
256
+#        writing.write(str(dict["wheel3_g"])+"\n")
257
+#        writing.write(str(dict["wheel3_b"])+"\n") 
258
+#        writing.write(str("//wheel4 color [r,g,b]")+"\n")
259
+#        writing.write(str(dict["wheel4_r"])+"\n")
260
+#        writing.write(str(dict["wheel4_g"])+"\n")
261
+#        writing.write(str(dict["wheel4_b"])+"\n")                                          
262
+#        writing.write(str("//deck index")+"\n")
263
+#        writing.write(str(dict["deck_index"])+"\n")        
264
+#        
265
+#        #dict['ccH_targetHeight']     
266
+#        
267
+#        #writing.write(str(own["framerate"])+"\n")
268
+#        print("writing settings")
269
+#        writing.close()
219 270
        
220 271
        
221 272
 def setres():
@@ -227,8 +278,8 @@ def setres():
227 278
     cont = GameLogic.getCurrentController()
228 279
     own2 = cont.owner
229 280
     dict = bge.logic.globalDict 
230
-    resx = dict["resx"]
231
-    resy = dict["resy"]
281
+    resx = int(dict["resx"])
282
+    resy = int(dict["resy"])
232 283
     fullscreen = bge.render.getFullScreen()
233 284
     print("fullscreen = ", fullscreen)
234 285
     if fullscreen != True:

+ 1
- 0
walk.py View File

@@ -27,6 +27,7 @@ try:
27 27
     own['walk_timer'] = own['walk_timer'] +1
28 28
 except:
29 29
     own['walk_timer'] = 1
30
+    own['walk_targ_speed'] = 2.0
30 31
 
31 32
 truckon = 450
32 33
 deckon = 460

Loading…
Cancel
Save