shuvit 6 years ago
parent
commit
373fbb4001
7 changed files with 1406 additions and 168 deletions
  1. 548
    0
      Manager.py
  2. 100
    0
      Startup.py
  3. 96
    106
      controller2.py
  4. 4
    2
      grindV2.py
  5. 209
    0
      inputs.py
  6. 388
    0
      pause.py
  7. 61
    60
      walk.py

+ 548
- 0
Manager.py View File

@@ -0,0 +1,548 @@
1
+#"""
2
+#Modified BGE Gameplay Recorder Version 2
3
+#originally written by Nicholas Anderson, aka Red Frost Games.
4
+#"""
5
+
6
+#####Tweakables###############
7
+#Watch out! These numbers might bite!
8
+frame_rate = 60    #Set this to the framerate of your game.
9
+optimization = 1    #An integer, must be at least 1! Higher value will make a smaller saved file size. I do not reccomend setting it to anything other than 1 though.
10
+recording_cutoff = 7300 #3600   #Frames at which the oldest recorded frame will be deleted. 0 is no cutoff.
11
+recorder_state = 1   #This is the main state of the recorder object. State will be reverted to this value when the user breaks out of the playback.
12
+allow_playback_break = True   #Allow the player to resume playing from the position in the recording.
13
+#####Sensor names#############
14
+record_sensor = "Record"
15
+save_recording_sensor = "Save"
16
+load_recording_sensor = "Load"
17
+track_left_sensor = "Left"
18
+track_right_sensor = "Right"
19
+break_sensor = "Break"
20
+##############################
21
+
22
+from bge import logic
23
+import Record
24
+import SortData
25
+
26
+cont = logic.getCurrentController()
27
+own = cont.owner
28
+
29
+cont.sensors[record_sensor].skippedTicks = optimization
30
+dict = logic.globalDict
31
+
32
+#dict['recorder_on'] = recorder_on
33
+recorder_on = dict.get('recorder_on')
34
+own['recorder_on'] = recorder_on
35
+#print("recorder on: ", recorder_on) 
36
+
37
+if recorder_on == 1:
38
+    #----
39
+    scene = logic.getCurrentScene()
40
+    scene_list = logic.getSceneList()
41
+    camList = scene.cameras
42
+    followcam = camList["followcam"]
43
+    freecam = camList["freecam"]
44
+    skater = scene.objects["Char4"]
45
+    cube = scene.objects["control_cube.002"]
46
+    deck = scene.objects["deck"]
47
+    trucks = scene.objects["trucks"]
48
+    replay_cam_axis = own['replay_cam_axis']
49
+    cam = own.actuators['Camera']
50
+    #----
51
+    joybutsens = "joyBut"
52
+    #butt = cont.sensors[joybutsens]
53
+    #aXis = cont.sensors["joysticksens"]
54
+    #bk_but = 4
55
+    back_on = dict['bkBut']
56
+    #a_but = 0
57
+    a_on = dict['aBut']
58
+    #b_but = 1
59
+    b_on = dict['bBut']
60
+    #print(a on)
61
+    last_back = own['last_back_but']
62
+    #last_back = own['last_a_but']
63
+#    reduction = 400000
64
+#    axisTh = 0.03 
65
+#    lt = 4
66
+#    rt = 5
67
+#    lts_pr = 7
68
+#    rts_pr = 8
69
+
70
+#    lar_lts = 0
71
+#    uad_lts = 1
72
+#    lar_rts = 2 
73
+#    uad_rts = 3 
74
+    #lts_pr = 7
75
+    #rts_pr = 8
76
+#    lTrig = aXis.axisValues[lt] / reduction
77
+#    rTrig = aXis.axisValues[rt] / reduction
78
+#    lLR = aXis.axisValues[lar_lts] / reduction
79
+#    lUD = aXis.axisValues[uad_lts] / reduction
80
+#    rLR = aXis.axisValues[lar_rts] / reduction
81
+#    rUD = aXis.axisValues[uad_rts] / reduction
82
+#    ltsBut = butt.getButtonStatus(lts_pr)
83
+#    rtsBut = butt.getButtonStatus(rts_pr) 
84
+#        
85
+    lLR = dict['lLR']
86
+    lUD = dict['lUD']
87
+    rLR = dict['rLR']
88
+    rUD = dict['rUD']
89
+    lTrig = dict['lTrig']
90
+    rTrig = dict['rTrig']
91
+    aBut = dict['aBut']
92
+    bBut = dict['bBut']
93
+    xBut = dict['xBut']
94
+    yBut = dict['yBut']
95
+    lBump = dict['lBump']
96
+    rBump = dict['rBump']
97
+    bkBut = dict['bkBut']
98
+    stBut = dict['stBut']
99
+    xbBut = dict['xbBut']
100
+    ltsBut = dict['ltsBut']
101
+    rtsBut = dict['rtsBut']
102
+    ldPad = dict['ldPad']
103
+    rdPad = dict['rdPad']
104
+    udPad = dict['udPad']
105
+    ddPad = dict['ddPad']    
106
+        
107
+    
108
+       
109
+    #trigs results range 0 - .08
110
+    #print(lTrig, rTrig)
111
+
112
+    #if cont.sensors[record_sensor].positive:
113
+    if own["playback"] != True:    
114
+        Record.main(recording_cutoff)
115
+        
116
+    if cont.sensors[save_recording_sensor].positive:
117
+        SortData.writeData.saveAll()
118
+        
119
+    #if cont.sensors[load_recording_sensor].positive or (cube["sel"] == 1 and cube["last_sel"] == 0):
120
+    if own['back_state'] == 1 and back_on == 1 and last_back == 0:
121
+        cube["last_sel"] == 1
122
+        SortData.writeData.saveAll()
123
+        own["playback"] = True
124
+        own["playbackBroken"] = False
125
+        freecam.worldPosition = own.worldPosition
126
+        followcam.worldPosition = own.worldPosition
127
+        
128
+
129
+    if own["playback"]:
130
+        Record.loadData()
131
+    #..................
132
+    if cont.sensors[track_left_sensor].positive:
133
+        own["objIndex"] -= 2
134
+        logic.setLogicTicRate(frame_rate*own["playbackSpeed"])
135
+        
136
+    if cont.sensors[track_right_sensor].positive:
137
+        own["objIndex"] += 2
138
+        logic.setLogicTicRate(frame_rate*own["playbackSpeed"])
139
+
140
+    if own["playback"] == True:    
141
+        if rTrig > .01 and rTrig < .02:
142
+            own["objIndex"] += 2
143
+            logic.setLogicTicRate(frame_rate*.5) 
144
+        if (rTrig >= .02 and rTrig < .06) or own['loop_play'] == 1:
145
+            own["objIndex"] += 2
146
+            logic.setLogicTicRate(frame_rate*1)
147
+            #print(own['objIndex'])
148
+        if rTrig >= .06 and rTrig < .09:
149
+            own["objIndex"] += 2
150
+            logic.setLogicTicRate(frame_rate*1.5) 
151
+        if lTrig > .01 and lTrig < .02:
152
+            own["objIndex"] -= 2
153
+            logic.setLogicTicRate(frame_rate*.5) 
154
+        if lTrig >= .02 and lTrig < .06:
155
+            own["objIndex"] -= 2
156
+            logic.setLogicTicRate(frame_rate*1)
157
+        if lTrig >= .06 and lTrig < .09:
158
+            if own['loop_play'] == 1:
159
+                own["objIndex"] -= 6
160
+                #logic.setLogicTicRate(frame_rate*1.5)
161
+            else:    
162
+                own["objIndex"] -= 2
163
+                logic.setLogicTicRate(frame_rate*1.5)
164
+        if b_on == True:
165
+            print("bbut_on")
166
+            own['objIndex'] = 0
167
+            own['valueIndex'] = 0 
168
+            logic.setLogicTicRate(frame_rate*1)                       
169
+
170
+    #....................
171
+    if allow_playback_break:
172
+
173
+        if own['back_state'] == 0 and back_on == 1 and last_back == 0:       
174
+            own["playbackBroken"] = True
175
+            own["playback"] = False
176
+            #print("break - add hud, remove stance (back_state == False)")
177
+            #cont.activate(own.actuators['add_hud'])
178
+            #cont.activate(own.actuators['remove_stance'])
179
+            #removescene = cont.actuators["remove_hud"]
180
+            #removescene.scene = "replay_HUD"
181
+            #addscene = cont.actuators["add_hud"]
182
+            #addscene.scene = "stance"
183
+            #cont.activate(addscene)        
184
+            #cont.activate(removescene)
185
+        elif own["playbackBroken"] and back_on == 0:
186
+            Record.breakOut()
187
+            #cont.activate(own.actuators['remove_hud'])
188
+            #cont.activate(own.actuators['add_stance'])
189
+            #addscene = cont.actuators["add_hud"]
190
+            #addscene.scene = "replay_HUD"
191
+            #removescene = cont.actuators["remove_hud"]
192
+            #removescene.scene = "stance"
193
+            #cont.activate(addscene)
194
+            #cont.activate(removescene)
195
+            
196
+            logic.setLogicTicRate(frame_rate)
197
+            #set value index
198
+            own.state = recorder_state
199
+            own["playbackBroken"] = False
200
+            skater.stopAction(9999)
201
+            deck.stopAction(9999)
202
+            trucks.stopAction(9999)
203
+            cont.activate(own.actuators['replayCam'])
204
+            print("unbreak")
205
+            own['loop_play'] = 0
206
+            #own['valueIndex'] = 0
207
+            #own["objIndex"] += 2
208
+            #logic.setLogicTicRate(frame_rate*1)
209
+            #own['objectIndex'] = 0
210
+            #print("valueIndex = ", own['valueIndex'])
211
+    if back_on == 1 and own['back_but'] == 0:
212
+        print("change back state")
213
+        if own['back_state'] == True:
214
+            own['back_state'] = False
215
+        #elif own['back_state'] == False:
216
+        else:
217
+            own['back_state'] = True
218
+###
219
+    if own['last_playback'] != own['playback']:
220
+        if own['last_playback'] == True:
221
+            cont.activate(own.actuators['remove_hud'])
222
+            cont.activate(own.actuators['add_stance']) 
223
+            own['camnum'] = 0
224
+            cam = camList["Camera.003"]
225
+            scene.active_camera = cam                        
226
+            print("turning replay off", own['playback'])
227
+            
228
+          
229
+        if own['last_playback'] == False:
230
+            print("turning replay on", own['playback'])
231
+            cont.activate(own.actuators['add_hud'])
232
+            cont.activate(own.actuators['remove_stance'])
233
+            own['objIndex'] = 0
234
+            own['valueIndex'] = 3
235
+            logic.setLogicTicRate(frame_rate*1)               
236
+             
237
+                         
238
+####
239
+    if a_on == 1 and own['a_but'] == False:
240
+        if own['loop_play'] == 1:
241
+            own['loop_play'] = 0
242
+        else:
243
+            own['loop_play'] = 1            
244
+    if rLR > .05 and own["playback"]:
245
+        act = cont.actuators["replayCam"]
246
+        if rLR > .07:
247
+            act.dLoc = [ .06, 0.0, 0.0]
248
+        else:
249
+            act.dLoc = [ .03, 0.0, 0.0]
250
+        #cont.deactivate(own.actuators['Camera'])
251
+        cont.activate(own.actuators['replayCam']) 
252
+        #print("move") 
253
+    elif rLR < -.05 and own["playback"]:
254
+        act = cont.actuators["replayCam"]
255
+        if rLR < -.07:
256
+            act.dLoc = [ -.06, 0.0, 0.0]
257
+        else:    
258
+            act.dLoc = [ -.03, 0.0, 0.0]
259
+        #cont.deactivate(own.actuators['Camera'])
260
+        #act.damping = 6
261
+        cont.activate(own.actuators['replayCam']) 
262
+        #print("move")         
263
+    else:  
264
+        #pass      
265
+        cont.deactivate(own.actuators['replayCam'])
266
+        #cont.activate(own.actuators['Camera'])
267
+    #print("back state: ", own['back_state'], "last_back_but: ", own['last_back_but'], "back_but :", own['back_but'])  
268
+    #integer
269
+    # 
270
+    #0 = +X axis
271
+    # 
272
+    #1 = +Y axis
273
+    # 
274
+    #2 = +Z axis
275
+    # 
276
+    #3 = -X axis
277
+    # 
278
+    #4 = -Y axis
279
+    # 
280
+    #5 = -Z axis
281
+#    if rLR > .05 and own["playback"]:
282
+#        if own['last_rtsBut'] == True and rtsBut == False:
283
+#            if replay_cam_axis == 0:
284
+#               replay_cam_axis = 1
285
+#            elif replay_cam_axis == 1:
286
+#                replay_cam_axis = 3
287
+#            elif replay_cam_axis == 3 :
288
+#                replay_cam_axis = 4
289
+#            elif replay_cam_axis == 4:
290
+#                replay_cam_axis = 0 
291
+#        cam.axis = replay_cam_axis
292
+#        cont.activate(cam)
293
+#        print("set replay_cam_axis: ", replay_cam_axis)
294
+#        own['replay_cam_axis'] = replay_cam_axis
295
+    if own['last_ltsBut'] == True and ltsBut == False and own['playback']:
296
+        # get camera named SecurityCam
297
+        if own['camnum'] == 1:
298
+            own['camnum'] = 2
299
+        elif own['camnum'] == 0:
300
+            own['camnum'] = 1 
301
+        elif own['camnum'] == 2:
302
+            own['camnum'] = 0    
303
+    if own['last_rtsBut'] == True and rtsBut == False and own['playback']:
304
+        # get camera named SecurityCam
305
+        if "replay_HUD" in scene_list:
306
+            cont.activate(own.actuators['remove_hud'])
307
+        else:
308
+            cont.activate(own.actuators['add_hud'])
309
+    if own['camnum'] == 1 and own['playback']:
310
+        
311
+        scene.active_camera = followcam 
312
+        #################
313
+        camspeed1 = .04 #.015
314
+        camspeed2 = .1 #.055
315
+        camrot1 = .02 #.005
316
+        camrot2 = .04 #.02
317
+        #up
318
+        if lUD < -0.080:
319
+            followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
320
+            cont.activate(followcam.actuators["up"])
321
+            #print("fastup")
322
+        else:
323
+            cont.deactivate(followcam.actuators["up"])    
324
+#            #down    
325
+        if lUD > .080:
326
+            followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
327
+            cont.activate(followcam.actuators["down"])
328
+        else:
329
+            cont.deactivate(followcam.actuators["down"])                    
330
+#            #left
331
+        if lLR < -0.080:
332
+            followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
333
+            cont.activate(followcam.actuators["left"])
334
+        else:
335
+            cont.deactivate(followcam.actuators["left"])                    
336
+#            #right
337
+        if lLR > 0.080:         
338
+            followcam.actuators["right"].dLoc = [camspeed2, 0, 0]                
339
+            cont.activate(followcam.actuators["right"])
340
+        else:
341
+            cont.deactivate(followcam.actuators["right"])  
342
+        #up
343
+        if rUD < -0.080:
344
+            followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
345
+            cont.activate(followcam.actuators["rotup"])
346
+            #print("uppppppppppppppppppppppppppp")
347
+        else:
348
+            cont.deactivate(followcam.actuators["rotup"])    
349
+#            #down    
350
+        if rUD > .080:
351
+            followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]                
352
+            cont.activate(followcam.actuators["rotdown"])
353
+        else:
354
+            cont.deactivate(followcam.actuators["rotdown"])                    
355
+#            #left
356
+        if rLR < -0.080:
357
+            followcam.actuators["rotleft"].dRot = [0, 0, camrot2]                
358
+            cont.activate(followcam.actuators["rotleft"])
359
+        else:
360
+            cont.deactivate(followcam.actuators["rotleft"])                    
361
+#            #right
362
+        if rLR > 0.080:         
363
+            followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
364
+            cont.activate(followcam.actuators["rotright"])
365
+        else:
366
+            cont.deactivate(followcam.actuators["rotright"]) 
367
+
368
+#*********************************************                
369
+            
370
+        if lUD > -0.080 and lUD < -0.030:
371
+            followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
372
+            cont.activate(followcam.actuators["up"])
373
+            #print(lUD)
374
+        else:
375
+            cont.deactivate(followcam.actuators["up"])    
376
+#            #down    
377
+        if lUD < .080 and lUD > .03:
378
+            followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]                
379
+            cont.activate(followcam.actuators["down"])
380
+        else:
381
+            cont.deactivate(followcam.actuators["down"])                    
382
+#            #left
383
+        if lLR > -0.080 and lLR < -0.030:
384
+            followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]                
385
+            cont.activate(followcam.actuators["left"])
386
+        else:
387
+            cont.deactivate(followcam.actuators["left"])                    
388
+#            #right
389
+        if lLR < .080 and lLR > .03:       
390
+            followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
391
+            cont.activate(followcam.actuators["right"])
392
+        else:
393
+            cont.deactivate(followcam.actuators["right"])  
394
+        #up
395
+        if rUD > -0.080 and rUD < -0.030:
396
+            followcam.actuators["rotup"].dRot = [camrot1, 0, 0]                
397
+            cont.activate(followcam.actuators["rotup"])
398
+        else:
399
+            cont.deactivate(followcam.actuators["rotup"])    
400
+#            #down    
401
+        if rUD < .080 and rUD > .03:
402
+            followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]                
403
+            cont.activate(followcam.actuators["rotdown"])
404
+        else:
405
+            cont.deactivate(followcam.actuators["rotdown"])                    
406
+#            #left
407
+        if rLR > -0.080 and rLR < -0.030:
408
+            followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
409
+            cont.activate(followcam.actuators["rotleft"])
410
+        else:
411
+            cont.deactivate(followcam.actuators["rotleft"])                    
412
+#            #right
413
+        if rLR < .080 and rLR > .03:         
414
+            followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
415
+            cont.activate(followcam.actuators["rotright"])
416
+        else:
417
+            cont.deactivate(followcam.actuators["rotright"])          
418
+        
419
+        #################
420
+        
421
+    if own['camnum'] == 2 and own['playback']:
422
+        
423
+        scene.active_camera = freecam
424
+        
425
+        #act = freecam.actuators[
426
+        camspeed1 = .015
427
+        camspeed2 = .055
428
+        camrot1 = .005
429
+        camrot2 = .02
430
+        #up
431
+        if lUD < -0.080:
432
+            freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
433
+            cont.activate(freecam.actuators["up"])
434
+            #print("fastup")
435
+        else:
436
+            cont.deactivate(freecam.actuators["up"])    
437
+#            #down    
438
+        if lUD > .080:
439
+            freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
440
+            cont.activate(freecam.actuators["down"])
441
+        else:
442
+            cont.deactivate(freecam.actuators["down"])                    
443
+#            #left
444
+        if lLR < -0.080:
445
+            freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
446
+            cont.activate(freecam.actuators["left"])
447
+        else:
448
+            cont.deactivate(freecam.actuators["left"])                    
449
+#            #right
450
+        if lLR > 0.080:         
451
+            freecam.actuators["right"].dLoc = [camspeed2, 0, 0]                
452
+            cont.activate(freecam.actuators["right"])
453
+        else:
454
+            cont.deactivate(freecam.actuators["right"])  
455
+        #up
456
+        if rUD < -0.080:
457
+            freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
458
+            cont.activate(freecam.actuators["rotup"])
459
+        else:
460
+            cont.deactivate(freecam.actuators["rotup"])    
461
+#            #down    
462
+        if rUD > .080:
463
+            freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]                
464
+            cont.activate(freecam.actuators["rotdown"])
465
+        else:
466
+            cont.deactivate(freecam.actuators["rotdown"])                    
467
+#            #left
468
+        if rLR < -0.080:
469
+            freecam.actuators["rotleft"].dRot = [0, 0, camrot2]                
470
+            cont.activate(freecam.actuators["rotleft"])
471
+        else:
472
+            cont.deactivate(freecam.actuators["rotleft"])                    
473
+#            #right
474
+        if rLR > 0.080:         
475
+            freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
476
+            cont.activate(freecam.actuators["rotright"])
477
+        else:
478
+            cont.deactivate(freecam.actuators["rotright"]) 
479
+
480
+#*********************************************                
481
+            
482
+        if lUD > -0.080 and lUD < -0.030:
483
+            freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
484
+            cont.activate(freecam.actuators["up"])
485
+            #print(lUD)
486
+        else:
487
+            cont.deactivate(freecam.actuators["up"])    
488
+#            #down    
489
+        if lUD < .080 and lUD > .03:
490
+            freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]                
491
+            cont.activate(freecam.actuators["down"])
492
+        else:
493
+            cont.deactivate(freecam.actuators["down"])                    
494
+#            #left
495
+        if lLR > -0.080 and lLR < -0.030:
496
+            freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]                
497
+            cont.activate(freecam.actuators["left"])
498
+        else:
499
+            cont.deactivate(freecam.actuators["left"])                    
500
+#            #right
501
+        if lLR < .080 and lLR > .03:       
502
+            freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
503
+            cont.activate(freecam.actuators["right"])
504
+        else:
505
+            cont.deactivate(freecam.actuators["right"])  
506
+        #up
507
+        if rUD > -0.080 and rUD < -0.030:
508
+            freecam.actuators["rotup"].dRot = [camrot1, 0, 0]                
509
+            cont.activate(freecam.actuators["rotup"])
510
+        else:
511
+            cont.deactivate(freecam.actuators["rotup"])    
512
+#            #down    
513
+        if rUD < .080 and rUD > .03:
514
+            freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]                
515
+            cont.activate(freecam.actuators["rotdown"])
516
+        else:
517
+            cont.deactivate(freecam.actuators["rotdown"])                    
518
+#            #left
519
+        if rLR > -0.080 and rLR < -0.030:
520
+            freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
521
+            cont.activate(freecam.actuators["rotleft"])
522
+        else:
523
+            cont.deactivate(freecam.actuators["rotleft"])                    
524
+#            #right
525
+        if rLR < .080 and rLR > .03:         
526
+            freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
527
+            cont.activate(freecam.actuators["rotright"])
528
+        else:
529
+            cont.deactivate(freecam.actuators["rotright"])        
530
+########################################                 
531
+    if own['camnum'] == 0:
532
+        cam = camList["Camera.003"]
533
+        scene.active_camera = cam          
534
+    valueIndex = own['valueIndex']
535
+    n = (valueIndex / recording_cutoff) * 1000
536
+    n = int(round(n))
537
+    #n = 10
538
+    #print("n: ", n, "--", valueIndex, recording_cutoff)
539
+    #dict = logic.globalDict #Get the global dictionary
540
+    dict['playhead'] = n 
541
+      
542
+    own['last_back_but'] = own['back_but']           
543
+    own['back_but'] = back_on
544
+    own['last_a_but'] = own['a_but']           
545
+    own['a_but'] = a_on
546
+    own['last_ltsBut'] = ltsBut
547
+    own['last_rtsBut'] = rtsBut
548
+    own['last_playback'] = own['playback']

+ 100
- 0
Startup.py View File

@@ -0,0 +1,100 @@
1
+import bge
2
+import GameLogic
3
+from bge import logic, render
4
+
5
+def main():
6
+    cont = GameLogic.getCurrentController() 
7
+    #cont = bge.logic.getCurrentController()
8
+    own = cont.owner
9
+    #bge.logic.addScene('Main')
10
+    #scenes = bge.logic.getSceneList()
11
+    #print(scenes)
12
+#-------
13
+    mainDir = GameLogic.expandPath("//")
14
+    fileName = mainDir + "Settings.dat" 
15
+    with open(fileName) as reading:
16
+            #data = [line.split()[0] for line in reading]
17
+            data = reading.readlines()
18
+            #print lines[25]
19
+            #print lines[29]
20
+            reading.close() 
21
+    resx = int(data[7])
22
+    resy = int(data[8]) 
23
+
24
+    #trick_string = dict.get('trick_string')                
25
+#    
26
+#    fullscreen = bge.render.getFullScreen()
27
+#    print("fullscreen = ", fullscreen)
28
+#    #if fullscreen != True:
29
+#        #bge.render.setFullScreen(True) 
30
+#    width = render.getWindowWidth()
31
+#    if width != resx:    
32
+#        bge.render.setWindowSize(resx, resy) 
33
+#---------
34
+    #bge.render.showFramerate
35
+    #bge.render.showProfile          
36
+    #dict = bge.logic.globalDict #Get the global dictionary
37
+    #print(dict)
38
+    #resx = dict['resx']
39
+    #resy = dict['resy']
40
+    #main_scene = [scene for scene in scenes if scene.name=="main"][0]
41
+#    
42
+#    for scene in scenes :
43
+#        if scene.name == 'Hud':
44
+#            player = scene.objects['player']
45
+#    print(scene.name)
46
+
47
+    #mains = main_scene.objects['Empty']
48
+    #resx = mains["resx"]
49
+    #resy = mains["resy"]
50
+    #print("read res: ", resx, resy)
51
+#    if not 'render_settings' in own:
52
+#        print("disable mips")
53
+#        render.setMipmapping(2)
54
+#    actu = cont.actuators['myActuator']
55
+#    cont.deactivate(actu)
56
+
57
+    dict = bge.logic.globalDict
58
+    
59
+    dict['kb_a'] = 0
60
+    dict['kb_d'] = 0
61
+    dict['kb_w'] = 0
62
+    dict['kb_s'] = 0
63
+    dict['kb_q'] = 0
64
+    dict['kb_e'] = 0
65
+    dict['kb_z'] = 0
66
+    dict['kb_c'] = 0 
67
+    dict['kb_en'] = 0    
68
+    dict['kb_la'] = 0
69
+    dict['kb_ra'] = 0
70
+    dict['kb_ua'] = 0
71
+    dict['kb_da'] = 0    
72
+    
73
+    dict['aBut'] = 0.0
74
+    dict['bBut'] = 0.0
75
+    dict['xBut'] = 0.0
76
+    dict['yBut'] = 0.0
77
+    dict['lBump'] = 0.0
78
+    dict['rBump'] = 0.0
79
+    dict['bkBut'] = 0.0
80
+    dict['stBut'] = 0.0
81
+    dict['xbBut'] = 0.0
82
+    dict['ltsBut'] = 0.0
83
+    dict['rtsBut'] = 0.0
84
+    dict['ldPad'] = 0.0
85
+    dict['rdPad'] = 0.0
86
+    dict['udPad'] = 0.0
87
+    dict['ddPad'] = 0.0
88
+    dict['rUD'] = 0.0
89
+    dict['lUD'] = 0.0
90
+    dict['rLR'] = 0.0
91
+    dict['lLR'] = 0.0
92
+    dict['rmUD'] = 0.0
93
+    dict['lmUD'] = 0.0
94
+    dict['rmLR'] = 0.0
95
+    dict['lmLR'] = 0.0
96
+    dict['mTrig'] = 0.0 
97
+    dict['lTrig'] = 0.0
98
+    dict['rTrig'] = 0.0 
99
+
100
+main()

+ 96
- 106
controller2.py View File

@@ -37,8 +37,8 @@ if init:
37 37
     if not GameLogic.DictObjects.has_key(name):
38 38
         GameLogic.DictObjects[name]=cont
39 39
     own.init=0
40
-reduction = 400000
41
-axisTh = 0.03 
40
+#reduction = 400000
41
+#axisTh = 0.03 
42 42
 
43 43
 #initialize quadrant variables
44 44
 q1on = 0
@@ -200,75 +200,98 @@ LAND_LAYER = 100
200 200
 LAND_END = 20
201 201
 
202 202
 #Sensor logic bricks connected to the python Controller  
203
-aXis = cont.sensors["sControla"]
204
-bUtt = cont.sensors["sControlb"]
203
+#aXis = cont.sensors["sControla"]
204
+#bUtt = cont.sensors["sControlb"]
205 205
 
206
-onW = onWindows()
206
+#onW = onWindows()
207 207
 
208
-# windows stuff
209
-lar_lts = 0
210
-uad_lts = 1
211
-lar_rts = 2 if onW else 2
212
-uad_rts = 3 if onW else 3
213
-lt = 4 if onW else 4
214
-rt = 5 if onW else 5
208
+## windows stuff
209
+#lar_lts = 0
210
+#uad_lts = 1
211
+#lar_rts = 2 if onW else 2
212
+#uad_rts = 3 if onW else 3
213
+#lt = 4 if onW else 4
214
+#rt = 5 if onW else 5
215 215
 
216 216
 # These are the numerical values associated with the buttons on the Xbox Controller 
217 217
 # Called with - SensorName.getButtonStatus(buttonnumber) - 
218 218
 # A joystick sensor logic brick (with the 'Button' Event Type; 'All Events' selected; and 'Tap' enabled) must be connected to the Python Controller logic brick to call these buttons 
219 219
 
220
-a_but = 0 if onW else 0
221
-b_but = 1 if onW else 1
222
-x_but = 2 if onW else 2
223
-y_but = 3 if onW else 3
224
-l_bump = 9 if onW else 9
225
-r_bump = 10 if onW else 10
226
-bk_but = 4 if onW else 4
227
-st_but = 6 if onW else 6
228
-xb_but = 5 if onW else 5
229
-lts_pr = 7 if onW else 7
230
-rts_pr = 8 if onW else 8
231
-l_dp = 13 if onW else 13
232
-r_dp = 14 if onW else 14
233
-u_dp = 11 if onW else 11
234
-d_dp = 12 if onW else 12
220
+#a_but = 0 if onW else 0
221
+#b_but = 1 if onW else 1
222
+#x_but = 2 if onW else 2
223
+#y_but = 3 if onW else 3
224
+#l_bump = 9 if onW else 9
225
+#r_bump = 10 if onW else 10
226
+#bk_but = 4 if onW else 4
227
+#st_but = 6 if onW else 6
228
+#xb_but = 5 if onW else 5
229
+#lts_pr = 7 if onW else 7
230
+#rts_pr = 8 if onW else 8
231
+#l_dp = 13 if onW else 13
232
+#r_dp = 14 if onW else 14
233
+#u_dp = 11 if onW else 11
234
+#d_dp = 12 if onW else 12
235
+
236
+#lLR = aXis.axisValues[lar_lts] / reduction
237
+#lUD = aXis.axisValues[uad_lts] / reduction
238
+#rLR = aXis.axisValues[lar_rts] / reduction
239
+#rUD = aXis.axisValues[uad_rts] / reduction
240
+#lTrig = aXis.axisValues[lt] / reduction
241
+#rTrig = aXis.axisValues[rt] / reduction
242
+#aBut = bUtt.getButtonStatus(a_but)
243
+#bBut = bUtt.getButtonStatus(b_but)
244
+#xBut = bUtt.getButtonStatus(x_but)
245
+#yBut = bUtt.getButtonStatus(y_but)
246
+#lBump = bUtt.getButtonStatus(l_bump)
247
+#rBump = bUtt.getButtonStatus(r_bump)
248
+#bkBut = bUtt.getButtonStatus(bk_but)
249
+#stBut = bUtt.getButtonStatus(st_but)
250
+#xbBut = bUtt.getButtonStatus(xb_but)
251
+#ltsBut = bUtt.getButtonStatus(lts_pr)
252
+#rtsBut = bUtt.getButtonStatus(rts_pr)
253
+#ldPad = bUtt.getButtonStatus(l_dp)
254
+#rdPad = bUtt.getButtonStatus(r_dp)
255
+#udPad = bUtt.getButtonStatus(u_dp)
256
+#ddPad = bUtt.getButtonStatus(d_dp)
257
+
258
+lLR = dict['lLR']
259
+lUD = dict['lUD']
260
+rLR = dict['rLR']
261
+rUD = dict['rUD']
262
+lTrig = dict['lTrig']
263
+rTrig = dict['rTrig']
264
+aBut = dict['aBut']
265
+bBut = dict['bBut']
266
+xBut = dict['xBut']
267
+yBut = dict['yBut']
268
+lBump = dict['lBump']
269
+rBump = dict['rBump']
270
+bkBut = dict['bkBut']
271
+stBut = dict['stBut']
272
+xbBut = dict['xbBut']
273
+ltsBut = dict['ltsBut']
274
+rtsBut = dict['rtsBut']
275
+ldPad = dict['ldPad']
276
+rdPad = dict['rdPad']
277
+udPad = dict['udPad']
278
+ddPad = dict['ddPad']
235 279
 
236
-lLR = aXis.axisValues[lar_lts] / reduction
237
-lUD = aXis.axisValues[uad_lts] / reduction
238
-rLR = aXis.axisValues[lar_rts] / reduction
239
-rUD = aXis.axisValues[uad_rts] / reduction
240
-lTrig = aXis.axisValues[lt] / reduction
241
-rTrig = aXis.axisValues[rt] / reduction
242
-aBut = bUtt.getButtonStatus(a_but)
243
-bBut = bUtt.getButtonStatus(b_but)
244
-xBut = bUtt.getButtonStatus(x_but)
245
-yBut = bUtt.getButtonStatus(y_but)
246
-lBump = bUtt.getButtonStatus(l_bump)
247
-rBump = bUtt.getButtonStatus(r_bump)
248
-bkBut = bUtt.getButtonStatus(bk_but)
249
-stBut = bUtt.getButtonStatus(st_but)
250
-xbBut = bUtt.getButtonStatus(xb_but)
251
-ltsBut = bUtt.getButtonStatus(lts_pr)
252
-rtsBut = bUtt.getButtonStatus(rts_pr)
253
-ldPad = bUtt.getButtonStatus(l_dp)
254
-rdPad = bUtt.getButtonStatus(r_dp)
255
-udPad = bUtt.getButtonStatus(u_dp)
256
-ddPad = bUtt.getButtonStatus(d_dp)
257 280
 
258 281
 ## -End- ##
259
-list = bUtt.getButtonActiveList()
282
+#list = bUtt.getButtonActiveList()
260 283
 #print(list)
261 284
 
262 285
 #no input
263
-def cutOff():
264
-    
265
- if (abs(lLR) < axisTh 
266
-     and abs(lUD) < axisTh 
267
-     and abs(rLR) < axisTh 
268
-     and abs(rUD) < axisTh
269
-     and aBut == False):
270
-         
271
-  return True
286
+#def cutOff():
287
+#    
288
+# if (abs(lLR) < axisTh 
289
+#     and abs(lUD) < axisTh 
290
+#     and abs(rLR) < axisTh 
291
+#     and abs(rUD) < axisTh
292
+#     and aBut == False):
293
+#         
294
+#  return True
272 295
 
273 296
 #fliptricks after manuals
274 297
 if (frame - own['last_manual_frame']) < 25:
@@ -3446,10 +3469,6 @@ def footplant():
3446 3469
     lF_air_frame = own['lF_air_frame']
3447 3470
     frames_since_ground = framenum - lF_air_frame
3448 3471
     frames_since_grind = framenum - own['last_grind_frame']
3449
-    #print(frames_since_ground, "fsg")
3450
-    #print(grindHit, r_ground.triggered)
3451
-    #print(own['footplant_on'], own['last_footplant'])
3452
-    #if LAST_GRIND == False and grindHit == True and aBut == True and frames_since_ground < 40 and touched:
3453 3472
     if grindHit == True and aBut == True:
3454 3473
         print("first invert check")
3455 3474
         own.linearVelocity.x = 0
@@ -3466,72 +3485,43 @@ def footplant():
3466 3485
         if skater.isPlayingAction(2925) == False:
3467 3486
             if STANCE == 0:
3468 3487
                 own['requestAction'] = 'reg_fp_rback'
3469
-                print("requesting footplant0")               
3488
+                #print("requesting footplant0")               
3470 3489
             if STANCE == 1:
3471 3490
                 own['requestAction'] = 'fak_fp_rback'
3472
-                print("requesting footplant1")
3491
+                #print("requesting footplant1")
3473 3492
            
3474 3493
 def invert():    
3475
-    if LAST_GRIND == False and grindHit == True and own['grindpos'] == 'reg_board':
3494
+    if grindHit == True and own['grindpos'] == 'reg_board':
3495
+    #if LAST_GRIND == False and grindHit == True and own['grindpos'] == 'reg_board':    
3476 3496
         if lBump == 1:
3477 3497
             #print("invert")
3478 3498
         #if coping_on ==1 and lBump == 1:
3479
-            print("invert")   
3499
+            #print("invert")   
3480 3500
             own['invert_on'] = 1
3481
-            own.setLinearVelocity([0,0,0],0)
3482
-    if own["coping"] == 1 and invert_on == 1:
3501
+            #invert_on = 1
3502
+            own.linearVelocity.x = 0
3503
+            own.linearVelocity.y = 0
3504
+    if own["coping"] == 1 and own['invert_on'] == 1:
3483 3505
         if own['invert_on'] == 1 and own['last_invert'] == False:
3484 3506
             #killall()
3485 3507
             cont.activate(own.actuators['invertOn_sound'])
3486 3508
             if STANCE == False:
3487 3509
                 own['invert_type'] = "reg_back_invert_in"
3488
-            #     skater.playAction("reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1) 
3489
-            #     deck.playAction("a_reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1)
3490
-            #     trucks.playAction("a_reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1) 
3491 3510
             if STANCE == True:
3492
-                own['invert_type'] = "fak_fr_invert"
3493
-            #     skater.playAction("fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1) 
3494
-            #     deck.playAction("a_fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)
3495
-            #     trucks.playAction("a_fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)                           
3496
-    if invert_on == 0 and own['last_invert'] == True:
3511
+                own['invert_type'] = "fak_fr_invert"                         
3512
+    if own['invert_on'] == 0 and own['last_invert'] == True:
3497 3513
         #print("kill invert")
3498 3514
         own['last_invert_frame'] = frame
3499 3515
         cont.activate(own.actuators['invertOff_Sound'])
3500
-        
3501
-        # killact(300)
3502
-        # killact(301)
3503
-        # killact(302)    
3504
-        # killact(303)
3505
-        # killact(304)
3506
-        # killact(305) 
3507
-        # killact(700)
3508
-        # killact(700)
3509
-        # killact(700)
3510
-        # killact(290)
3511
-        # killact(291)
3512
-        # killact(292)
3513
-        # if own['invert_type'] == "reg_back_invert_in":
3514
-        #     skater.playAction("reg_back_invert_in", 20,0, layer=306, play_mode=0, speed=1) 
3515
-        #     deck.playAction("a_reg_back_invert_in", 20,0, layer=306, play_mode=0, speed=1)
3516
-        #     trucks.playAction("a_reg_back_invert_in", 20,0, layer=306, play_mode=0, speed=1)
3517
-        # if own['invert_type'] == "fak_fr_invert":    
3518
-        #     skater.playAction("fak_fr_invert", 20,0, layer=306, play_mode=0, speed=1) 
3519
-        #     deck.playAction("a_fak_fr_invert", 20,0, layer=306, play_mode=0, speed=1)
3520
-        #     trucks.playAction("a_fak_fr_invert", 20,0, layer=306, play_mode=0, speed=1)             
3521
-    if invert_on == 1:
3516
+ 
3517
+    if own['invert_on'] == 1:
3522 3518
         if own['invert_type'] == "reg_back_invert_in":
3523 3519
             own['requestAction'] = 'reg_back_invert'
3524
-            #skater.playAction("reg_back_invert_in", 30,30, layer=290, play_mode=1, speed=1) 
3525
-            #deck.playAction("a_reg_back_invert_in", 30,30, layer=290, play_mode=1, speed=1)
3526
-            #trucks.playAction("a_reg_back_invert_in", 30,30, layer=290, play_mode=1, speed=1)
3527
-            
3520
+  
3528 3521
         if own['invert_type'] == "fak_fr_invert":
3529 3522
             own['requestAction'] = 'fak_fr_invert'
3530
-                #skater.playAction("fak_fr_invert", 30,30, layer=290, play_mode=1, speed=1) 
3531
-                #deck.playAction("a_fak_fr_invert", 30,30, layer=290, play_mode=1, speed=1)
3532
-                #trucks.playAction("a_fak_fr_invert", 30,30, layer=290, play_mode=1, speed=1)
3533 3523
     lif = own['last_invert_frame'] 
3534
-    if frame - lif > 3 and invert_on == 0:
3524
+    if frame - lif > 3 and own['invert_on'] == 0:
3535 3525
         own['invert_type'] = None
3536 3526
         
3537 3527
     if grindHit == False:

+ 4
- 2
grindV2.py View File

@@ -537,7 +537,9 @@ def main():
537 537
         #own.alignAxisToVect(vect, 0, 0)
538 538
             own.worldPosition = [nearestObject.worldPosition.x, nearestObject.worldPosition.y, nearestObject.worldPosition.z +.1]
539 539
             #own.setLinearVelocity([0, 0.0, 0], 1)                    
540
-        
540
+            own.linearVelocity.x = 0
541
+            own.linearVelocity.y = 0
542
+            print("setting invertpos")
541 543
                
542 544
             
543 545
     
@@ -559,7 +561,7 @@ def main():
559 561
         
560 562
         if invert_on:
561 563
             invertpos(detectedObjects)
562
-            print('invertOn')
564
+            #print('invertOn')
563 565
 
564 566
         grind_dist = .8#.6
565 567
         if dist < grind_dist and grindold == 0 and dropin == 0 and grind_jump == 0 and own["grindoutturn"] == 0 and gt_cd == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject and own['grindjumpturn'] == 0 and own['gt_cd2'] == 0 and invert_on == False:

+ 209
- 0
inputs.py View File

@@ -0,0 +1,209 @@
1
+################################################
2
+#inputs.py                                     #
3
+#inputs to global dict                         #
4
+#shuvit.org                                    #
5
+################################################
6
+
7
+import bge
8
+from bge import events
9
+from bge import logic as G
10
+
11
+def main():
12
+#####
13
+    #init
14
+    cont = bge.logic.getCurrentController()
15
+    scene = bge.logic.getCurrentScene()
16
+    own = cont.owner
17
+    dict = bge.logic.globalDict #Get the global dictionary
18
+    aXis = cont.sensors['Joystick.001']
19
+    bUtt = cont.sensors['Joystick'] 
20
+    reduction = 400000
21
+    axisTh = 0.03    
22
+    
23
+#hard controller mappings    
24
+    lar_lts = 0
25
+    uad_lts = 1
26
+    lar_rts = 2 
27
+    uad_rts = 3 
28
+    lt = 4 
29
+    rt = 5  
30
+    a_but = 0 
31
+    b_but = 1 
32
+    x_but = 2 
33
+    y_but = 3 
34
+    l_bump = 9 
35
+    r_bump = 10 
36
+    bk_but = 4 
37
+    st_but = 6 
38
+    xb_but = 5 
39
+    lts_pr = 7 
40
+    rts_pr = 8 
41
+    l_dp = 13 
42
+    r_dp = 14 
43
+    u_dp = 11 
44
+    d_dp = 12 
45
+
46
+    reduction = 400000
47
+    axisTh = 0.03    
48
+
49
+#get controller axis value 0-100    
50
+    lLR = aXis.axisValues[lar_lts] / reduction 
51
+    lUD = aXis.axisValues[uad_lts] / reduction 
52
+    rLR = aXis.axisValues[lar_rts] / reduction 
53
+    rUD = aXis.axisValues[uad_rts] / reduction 
54
+    lTrig = aXis.axisValues[lt] / reduction 
55
+    rTrig = aXis.axisValues[rt] / reduction 
56
+
57
+    aBut = bUtt.getButtonStatus(a_but)
58
+    bBut = bUtt.getButtonStatus(b_but)
59
+    xBut = bUtt.getButtonStatus(x_but)
60
+    yBut = bUtt.getButtonStatus(y_but)
61
+    lBump = bUtt.getButtonStatus(l_bump)
62
+    rBump = bUtt.getButtonStatus(r_bump)
63
+    bkBut = bUtt.getButtonStatus(bk_but)
64
+    stBut = bUtt.getButtonStatus(st_but)
65
+    xbBut = bUtt.getButtonStatus(xb_but)
66
+    ltsBut = bUtt.getButtonStatus(lts_pr)
67
+    rtsBut = bUtt.getButtonStatus(rts_pr)
68
+    ldPad = bUtt.getButtonStatus(l_dp)
69
+    rdPad = bUtt.getButtonStatus(r_dp)
70
+    udPad = bUtt.getButtonStatus(u_dp)
71
+    ddPad = bUtt.getButtonStatus(d_dp)
72
+
73
+    
74
+    #create modified axis values
75
+    if lLR < -20:
76
+        lmLR = round((lLR + 20) / 80 * 100, 0) 
77
+    elif lLR > 20:
78
+        lmLR = round((lLR - 20) / 80 * 100, 0)
79
+    else: lmLR = 0  
80
+          
81
+    if lUD > 20:
82
+        lmUD = round((lUD - 20) / 80 * 100, 0)
83
+    elif lUD < -20:
84
+        lmUD = round((lUD + 20) / 80 * 100, 0)
85
+    else: lmUD = 0 
86
+
87
+    if rLR < -20:
88
+        rmLR = round((rLR + 20) / 80 * 100, 0)
89
+    elif rLR > 20:
90
+        rmLR = round((rLR - 20) / 80 * 100, 0)
91
+    else: rmLR = 0         
92
+    
93
+    if rUD > 20:
94
+        rmUD = round((rUD - 20) / 80 * 100, 0)
95
+    elif rUD < -20:
96
+        rmUD = round((rUD + 20) / 80 * 100, 0)
97
+    else: rmUD = 0 
98
+  
99
+    if lTrig > 3:
100
+        mTrig = lTrig * -1
101
+    elif rTrig > 3:
102
+        mTrig = rTrig    
103
+    else: mTrig = 0
104
+    #    
105
+
106
+    keyboard = G.keyboard.events
107
+    # KEY BINDINGS
108
+    kb_a = events.AKEY 
109
+    kb_d = events.DKEY 
110
+    kb_w = events.WKEY
111
+    kb_s = events.SKEY
112
+    kb_q = events.QKEY
113
+    kb_e = events.EKEY
114
+    kb_z = events.ZKEY
115
+    kb_c = events.CKEY      
116
+    kb_en = events.ENTERKEY   
117
+    kb_la = events.LEFTARROWKEY
118
+    kb_ra = events.RIGHTARROWKEY
119
+    kb_ua = events.UPARROWKEY
120
+    kb_da = events.DOWNARROWKEY
121
+    #if keyboard[kb_a]:
122
+    #print(keyboard[kb_a])
123
+    
124
+    dict['last_kb_a'] = dict['kb_a']
125
+    dict['last_kb_d'] = dict['kb_d']
126
+    dict['last_kb_w'] = dict['kb_w']
127
+    dict['last_kb_s'] = dict['kb_s']
128
+    dict['last_kb_q'] = dict['kb_q']
129
+    dict['last_kb_e'] = dict['kb_e']
130
+    dict['last_kb_z'] = dict['kb_z']
131
+    dict['last_kb_c'] = dict['kb_c']  
132
+    dict['last_kb_en'] = dict['kb_en']  
133
+    dict['last_kb_la'] = dict['kb_la']
134
+    dict['last_kb_ra'] = dict['kb_ra']
135
+    dict['last_kb_ua'] = dict['kb_ua']
136
+    dict['last_kb_da'] = dict['kb_da']    
137
+    
138
+    dict['kb_a'] = keyboard[kb_a]
139
+    dict['kb_d'] = keyboard[kb_d]
140
+    dict['kb_w'] = keyboard[kb_w]
141
+    dict['kb_s'] = keyboard[kb_s]
142
+    dict['kb_q'] = keyboard[kb_q]
143
+    dict['kb_e'] = keyboard[kb_e]
144
+    dict['kb_z'] = keyboard[kb_z]
145
+    dict['kb_c'] = keyboard[kb_c]    
146
+    dict['kb_en'] = keyboard[kb_en]
147
+    dict['kb_la'] = keyboard[kb_la]
148
+    dict['kb_ra'] = keyboard[kb_ra]
149
+    dict['kb_ua'] = keyboard[kb_ua]
150
+    dict['kb_da'] = keyboard[kb_da]        
151
+    
152
+    
153
+    dict['last_aBut'] = dict['aBut']
154
+    dict['last_bBut'] = dict['bBut']
155
+    dict['last_xBut'] = dict['xBut']
156
+    dict['last_yBut'] = dict['yBut']
157
+    dict['last_lBump'] = dict['lBump']
158
+    dict['last_rBump'] = dict['rBump']
159
+    dict['last_bkBut'] = dict['bkBut']
160
+    dict['last_stBut'] = dict['stBut']
161
+    dict['last_xbBut'] = dict['xbBut']
162
+    dict['last_ltsBut'] = dict['ltsBut']
163
+    dict['last_rtsBut'] = dict['rtsBut']
164
+    dict['last_ldPad'] = dict['ldPad']
165
+    dict['last_rdPad'] = dict['rdPad']
166
+    dict['last_udPad'] = dict['udPad']
167
+    dict['last_ddPad'] = dict['ddPad']
168
+    dict['last_rUD'] = dict['rUD']
169
+    dict['last_lUD'] = dict['lUD']
170
+    dict['last_rLR'] = dict['rLR']
171
+    dict['last_lLR'] = dict['lLR']
172
+    dict['last_rmUD'] = dict['rmUD']
173
+    dict['last_lmUD'] = dict['lmUD']
174
+    dict['last_rmLR'] = dict['rmLR']
175
+    dict['last_lmLR'] = dict['lmLR']
176
+    dict['last_mTrig'] = dict['mTrig'] 
177
+    dict['last_rTrig'] = dict['rTrig'] 
178
+    dict['last_lTrig'] = dict['lTrig']    
179
+
180
+    dict['aBut'] = aBut
181
+    dict['bBut'] = bBut
182
+    dict['xBut'] = xBut
183
+    dict['yBut'] = yBut
184
+    dict['lBump'] = lBump
185
+    dict['rBump'] = rBump
186
+    dict['bkBut'] = bkBut
187
+    dict['stBut'] = stBut
188
+    dict['xbBut'] = xbBut
189
+    dict['ltsBut'] = ltsBut
190
+    dict['rtsBut'] = rtsBut
191
+    dict['ldPad'] = ldPad
192
+    dict['rdPad'] = rdPad
193
+    dict['udPad'] = udPad
194
+    dict['ddPad'] = ddPad
195
+    dict['rUD'] = rUD
196
+    dict['lUD'] = lUD
197
+    dict['rLR'] = rLR
198
+    dict['lLR'] = lLR
199
+    dict['rmUD'] = rmUD
200
+    dict['lmUD'] = lmUD
201
+    dict['rmLR'] = rmLR
202
+    dict['lmLR'] = lmLR
203
+    dict['mTrig'] = mTrig
204
+    dict['rTrig'] = rTrig
205
+    dict['lTrig'] = lTrig
206
+
207
+
208
+main()
209
+

+ 388
- 0
pause.py View File

@@ -0,0 +1,388 @@
1
+import bge
2
+cont = bge.logic.getCurrentController()
3
+own = cont.owner
4
+
5
+
6
+os = 'Windows'
7
+from sys import platform
8
+if platform != "win32":
9
+ os = 'Linux'
10
+def onWindows():
11
+ return os == 'Windows'
12
+
13
+reduction = 400000
14
+axisTh = 0.03 
15
+
16
+#Sensor logic bricks connected to the python Controller  
17
+aXis = cont.sensors["sControla"]
18
+bUtt = cont.sensors["sControlb"]
19
+
20
+onW = onWindows()
21
+
22
+# windows stuff
23
+lar_lts = 0
24
+uad_lts = 1
25
+lt = 4 if onW else 2
26
+lar_rts = 2 if onW else 3
27
+uad_rts = 3 if onW else 4
28
+rt = 5
29
+
30
+# These are the numerical values associated with the buttons on the Xbox Controller 
31
+# Called with - SensorName.getButtonStatus(buttonnumber) - 
32
+# A joystick sensor logic brick (with the 'Button' Event Type; 'All Events' selected; and 'Tap' enabled) must be connected to the Python Controller logic brick to call these buttons 
33
+
34
+a_but = 0 if onW else 0
35
+b_but = 1 if onW else 1
36
+x_but = 2 if onW else 2
37
+y_but = 3 if onW else 3
38
+l_bump = 9 if onW else 4
39
+r_bump = 10 if onW else 5
40
+bk_but = 4 if onW else 6
41
+st_but = 6 if onW else 7
42
+xb_but = 5 if onW else 8
43
+lts_pr = 7 if onW else 9
44
+rts_pr = 8 if onW else 10
45
+l_dp = 13 if onW else 11
46
+r_dp = 14 if onW else 12
47
+u_dp = 11 if onW else 13
48
+d_dp = 12 if onW else 14
49
+
50
+lLR = aXis.axisValues[lar_lts] / reduction
51
+lUD = aXis.axisValues[uad_lts] / reduction
52
+rLR = aXis.axisValues[lar_rts] / reduction
53
+rUD = aXis.axisValues[uad_rts] / reduction
54
+lTrig = aXis.axisValues[lt] / reduction
55
+rTrig = aXis.axisValues[rt] / reduction
56
+aBut = bUtt.getButtonStatus(a_but)
57
+bBut = bUtt.getButtonStatus(b_but)
58
+xBut = bUtt.getButtonStatus(x_but)
59
+yBut = bUtt.getButtonStatus(y_but)
60
+lBump = bUtt.getButtonStatus(l_bump)
61
+rBump = bUtt.getButtonStatus(r_bump)
62
+bkBut = bUtt.getButtonStatus(bk_but)
63
+stBut = bUtt.getButtonStatus(st_but)
64
+xbBut = bUtt.getButtonStatus(xb_but)
65
+ltsBut = bUtt.getButtonStatus(lts_pr)
66
+rtsBut = bUtt.getButtonStatus(rts_pr)
67
+ldPad = bUtt.getButtonStatus(l_dp)
68
+rdPad = bUtt.getButtonStatus(r_dp)
69
+udPad = bUtt.getButtonStatus(u_dp)
70
+ddPad = bUtt.getButtonStatus(d_dp)
71
+#print(lUD)
72
+axis_sens = .06
73
+#print(aBut)
74
+lasta = own["lasta"]
75
+
76
+if lUD > axis_sens: down = 1
77
+else: down = 0    
78
+if lUD < -axis_sens: 
79
+    up = 1 
80
+    #print("up")
81
+else: up = 0    
82
+#print(down, up)
83
+if lLR > axis_sens: right = 1
84
+else: right = 0 
85
+if lLR < -axis_sens: left = 1
86
+else: left = 0 
87
+
88
+fileName = "Settings.dat"
89
+scenes = bge.logic.getSceneList()
90
+#print(scenes)
91
+main_scene = [scene for scene in scenes if scene.name=="main"][0]
92
+main_empty = main_scene.objects['Empty']
93
+
94
+def main():
95
+
96
+    cont = bge.logic.getCurrentController()
97
+    own = cont.owner
98
+    #down = cont.sensors["down"]
99
+    #up = cont.sensors["up"]
100
+    #bBut = cont.sensors["bBut"]
101
+    #aBut = cont.sensors["aBut"]
102
+    pstate = own["pstate"]
103
+    scene = bge.logic.getCurrentScene()
104
+    resume = scene.objects["resume"]
105
+    settings = scene.objects["settings"]
106
+    level = scene.objects["level"]
107
+    levelselect = scene.objects["levelselect"]
108
+    restart = scene.objects["restart"]
109
+    exit = scene.objects["exit"]
110
+    submenu_on = own["submenu_on"]
111
+    level_text = scene.objects["level_text"]
112
+    level_text.resolution = 8
113
+    lastup = own["lastup"]
114
+    lastdown = own["lastdown"]
115
+    lastleft = own["lastleft"]
116
+    lastright = own["lastright"]    
117
+    lastpstate = own["lastpstate"]
118
+    playspeed = 2
119
+    #sSelect = cont.actuators["sSelect"]
120
+    cont.deactivate(own.actuators['restart'])                                        
121
+    #joy down
122
+    if down == 1 and lastdown != 1:
123
+        #own.stopAction(0)
124
+        pstate = own["pstate"]
125
+                    
126
+        if pstate == 0 and submenu_on == 0:
127
+            resume.playAction("p_resume", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
128
+        if pstate == 1 and submenu_on == 0:
129
+            settings.playAction("p_settings", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
130
+        if pstate == 2 and submenu_on == 0:
131
+            level.playAction("p_level", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
132
+            #level.playAction("p_level_select", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
133
+        if pstate == 3 and submenu_on == 0:
134
+            restart.playAction("p_restart", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
135
+        if pstate == 4 and submenu_on == 0:
136
+            exit.playAction("p_exit", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)           
137
+            
138
+        if pstate < 4 and submenu_on == 0:
139
+            own["pstate"] = own["pstate"] + 1
140
+        if pstate == 4 and submenu_on == 0:
141
+            own["pstate"] = 0    
142
+        pstate = own["pstate"]
143
+        #print(pstate)   
144
+        cont.activate(own.actuators['sSelect']) 
145
+    #joy up    
146
+    if up == 1 and lastup != 1:
147
+        pstate = own["pstate"]
148
+                    
149
+        if pstate == 0 and submenu_on == 0:
150
+            resume.playAction("p_resume", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
151
+        if pstate == 1 and submenu_on == 0:
152
+            settings.playAction("p_settings", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
153
+        if pstate == 2 and submenu_on == 0:
154
+            level.playAction("p_level", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
155
+        if pstate == 3 and submenu_on == 0:
156
+            restart.playAction("p_restart", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
157
+        if pstate == 4 and submenu_on == 0:
158
+            exit.playAction("p_exit", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
159
+            
160
+            
161
+        if pstate > 0 and submenu_on == 0:
162
+            own["pstate"] = own["pstate"] - 1
163
+        if pstate == 0 and submenu_on == 0:
164
+            own["pstate"] = 4    
165
+        pstate = own["pstate"]
166
+        #print(pstate)    
167
+        cont.activate(own.actuators['sSelect'])  
168
+    if right == 1 and lastright !=1:
169
+        cont.activate(own.actuators['sSelect']) 
170
+    if left == 1 and lastleft != 1:    
171
+        cont.activate(own.actuators['sSelect'])
172
+        
173
+#level*****************************************************
174
+
175
+    if own["submenu"] == "level":
176
+        #print("submenu is level")
177
+        active_level_select = own["active_level_select"]
178
+        
179
+        import Settings
180
+        if left == 1 and lastleft != 1:
181
+            if active_level_select >= 0:
182
+               active_level_select -= 1
183
+            if active_level_select < 0:
184
+                active_level_select = 8    
185
+            #if active_level_select == -1:    
186
+                #active_level_select = 0
187
+        #print(active_level_select)        
188
+            #move up
189
+            #play up            
190
+        if right == 1 and lastright != 1:    
191
+            if active_level_select < 9:
192
+               active_level_select += 1               
193
+            if active_level_select == 9:
194
+                active_level_select = 0
195
+            if active_level_select == -1:    
196
+                active_level_select = 0
197
+        print(active_level_select)                        
198
+            #move down
199
+            #play down
200
+        if active_level_select == 0:
201
+            level_text.text = "Empty Lot"
202
+        if active_level_select == 1:
203
+            level_text.text = "Waterfall"
204
+        if active_level_select == 2:
205
+            level_text.text = "Warehouse" 
206
+        if active_level_select == 3:
207
+            level_text.text = "City"          
208
+        if active_level_select == 4:
209
+            level_text.text = "Training"          
210
+        if active_level_select == 5:
211
+            level_text.text = "Spine" 
212
+        if active_level_select == 6:
213
+            level_text.text = "Apricot Park" 
214
+        if active_level_select == 7:
215
+            level_text.text = "Waiting Room"                           
216
+        if active_level_select == 8:
217
+            level_text.text = "8 (n/a)"                                                                      
218
+        own["active_level_select"] = active_level_select 
219
+#indoor
220
+        if aBut == False and active_level_select == 0 and lasta == 1:
221
+            level_text.text = ""
222
+            cont.activate(own.actuators['loading']) 
223
+            level = "lot"
224
+            main_empty["level"] = "lot"
225
+            own["level"] = level
226
+            Settings.writeSettings()
227
+            print("not")
228
+            Settings.readSettings()
229
+            cont.activate(own.actuators['restart'])
230
+            #Settings.loadlevel() 
231
+        else: 
232
+            
233
+            cont.deactivate(own.actuators['restart']) 
234
+#woodbowl               
235
+        if aBut == False and active_level_select == 1 and lasta == 1:
236
+            level_text.text = ""
237
+            cont.activate(own.actuators['loading']) 
238
+            level = "mini_scene"
239
+            main_empty["level"] = "mini_scene"
240
+            own["level"] = level
241
+            Settings.writeSettings()
242
+            Settings.readSettings()
243
+            cont.activate(own.actuators['restart']) 
244
+            #Settings.loadlevel()
245
+        else: cont.deactivate(own.actuators['restart']) 
246
+#mini        
247
+        if aBut == False and active_level_select == 2 and lasta == 1:
248
+            level_text.text = ""
249
+            cont.activate(own.actuators['loading']) 
250
+            level = "warehouse"
251
+            main_empty["level"] = "warehouse"
252
+            own["level"] = level
253
+            Settings.writeSettings()
254
+            Settings.readSettings()
255
+            cont.activate(own.actuators['restart']) 
256
+            #Settings.loadlevel()
257
+        else: cont.deactivate(own.actuators['restart'])
258
+#level3        
259
+        if aBut == False and active_level_select == 3 and lasta == 1:
260
+            level_text.text = ""
261
+            level = "level3"
262
+            main_empty["level"] = "city2"
263
+            own["level"] = level
264
+            Settings.writeSettings()
265
+            Settings.readSettings()
266
+            cont.activate(own.actuators['restart']) 
267
+            #Settings.loadlevel()
268
+        else: cont.deactivate(own.actuators['restart']) 
269
+#hubbas rail        
270
+        if aBut == False and active_level_select == 4 and lasta == 1:
271
+            level_text.text = ""
272
+            level = "train"
273
+            main_empty["level"] = "train"
274
+            own["level"] = level
275
+            Settings.writeSettings()
276
+            Settings.readSettings()
277
+            cont.activate(own.actuators['restart']) 
278
+            #Settings.loadlevel()
279
+        else: cont.deactivate(own.actuators['restart']) 
280
+#training        
281
+        if aBut == False and active_level_select == 5 and lasta == 1:
282
+            level_text.text = ""
283
+            level = "level3"
284
+            main_empty["level"] = "spine"
285
+            own["level"] = level
286
+            Settings.writeSettings()
287
+            Settings.readSettings()
288
+            cont.activate(own.actuators['restart']) 
289
+            #Settings.loadlevel()
290
+        else: cont.deactivate(own.actuators['restart'])  
291
+        if aBut == False and active_level_select == 6 and lasta == 1:
292
+            level_text.text = ""
293
+            level = "gt"
294
+            main_empty["level"] = "gt"
295
+            own["level"] = level
296
+            Settings.writeSettings()
297
+            Settings.readSettings()
298
+            cont.activate(own.actuators['restart']) 
299
+            #Settings.loadlevel()
300
+        else: cont.deactivate(own.actuators['restart']) 
301
+        if aBut == False and active_level_select == 7 and lasta == 1:
302
+            level_text.text = ""
303
+            level = "store"
304
+            main_empty["level"] = "store"
305
+            own["level"] = level
306
+            Settings.writeSettings()
307
+            Settings.readSettings()
308
+            cont.activate(own.actuators['restart']) 
309
+            #Settings.loadlevel()
310
+        else: cont.deactivate(own.actuators['restart']) 
311
+        if aBut == False and active_level_select == 8 and lasta == 1:
312
+            level_text.text = ""
313
+            level = "level3"
314
+            main_empty["level"] = "spine"
315
+            own["level"] = level
316
+            Settings.writeSettings()
317
+            Settings.readSettings()
318
+            cont.activate(own.actuators['restart']) 
319
+            #Settings.loadlevel()
320
+        else: cont.deactivate(own.actuators['restart'])                                               
321
+    else:
322
+        own["active_level_select"] = -1 
323
+    if bBut == True:    
324
+        levelselect.playAction("p_level_select", 10,0, layer=3, priority=0, play_mode=0, speed=playspeed)                                         
325
+#**********************************************************   
326
+
327
+
328
+
329
+    if bBut == 1:
330
+        cont.activate(own.actuators['sBack']) 
331
+        #cont.activate(own.actuators['exit']) 
332
+        print("bbut")
333
+    #go to level submenu        
334
+    if aBut == True and pstate == 2:
335
+        cont.activate(own.actuators['sEnter']) 
336
+        #cont.activate(own.actuators['quit']) 
337
+        #print("level")       
338
+        own["submenu_on"] = 1
339
+        own["submenu"] = "level"
340
+        level_text.text = "<choose>"
341
+        levelselect.playAction("p_level_select", -10,10, layer=3, priority=0, play_mode=0, speed=playspeed)
342
+    #exit submenu
343
+    if bBut and submenu_on == 1:
344
+        own["submenu_on"] = 0  
345
+        own["submenu"] = None  
346
+        level_text.text = "" 
347
+    
348
+    #exit    
349
+    if aBut == 1 and pstate == 4:
350
+        cont.activate(own.actuators['sEnter']) 
351
+        cont.activate(own.actuators['quit']) 
352
+        print("bbut")  
353
+
354
+    if pstate == 0 and submenu_on == 0 and lastpstate != 0:
355
+        resume.playAction("p_resume", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
356
+    if pstate == 1 and submenu_on == 0 and lastpstate != 1:
357
+        settings.playAction("p_settings", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
358
+    if pstate == 2 and submenu_on == 0 and lastpstate != 2:
359
+        level.playAction("p_level", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
360
+        #level.playAction("p_level_select", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
361
+    if pstate == 3 and submenu_on == 0 and lastpstate != 3:
362
+        restart.playAction("p_restart", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
363
+    if pstate == 4 and submenu_on == 0 and lastpstate != 4:
364
+        exit.playAction("p_exit", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)                
365
+
366
+
367
+    #find the scene and object
368
+    scenes = bge.logic.getSceneList()
369
+    for scene in scenes :
370
+        #if scene.name == 'lot' or scene.name == 'train' or scene.name == 'mini_scene' or scene.name == 'city' or scene.name == 'city2' or scene.name == 'spine':
371
+        #if scene.name == main_empty["level"]: 
372
+        if scene.name == 'lot':    
373
+            #print("*****stop sounds")
374
+            cc = scene.objects['control_cube.002']
375
+            cc.actuators["sroll"].volume = .0001
376
+            #cc.deactivate(own.actuators["sroll"])
377
+            cc.actuators["sroll"].stopSound()            
378
+
379
+
380
+ 
381
+    #print(pstate) 
382
+    own["lastup"] = up
383
+    own["lastdown"] = down 
384
+    own["lastleft"] = left
385
+    own["lastright"] = right 
386
+    own["lasta"] = aBut 
387
+    own["lastpstate"] = own["pstate"]
388
+main()

+ 61
- 60
walk.py View File

@@ -1,7 +1,7 @@
1
-os = 'Windows'
2
-from sys import platform
3
-if platform != "win32":
4
- os = 'Linux'
1
+#os = 'Windows'
2
+#from sys import platform
3
+#if platform != "win32":
4
+ #os = 'Linux'
5 5
 def onWindows():
6 6
  return os == 'Windows'
7 7
 import bge
@@ -14,8 +14,8 @@ import random
14 14
 scene = bge.logic.getCurrentScene()
15 15
 objList = scene.objects
16 16
 
17
-reduction = 400000
18
-axisTh = 0.03 
17
+#reduction = 400000
18
+#axisTh = 0.03 
19 19
 
20 20
 ############
21 21
 ##vibration#
@@ -51,12 +51,13 @@ stance = own['stance']
51 51
 STANCE = own['stance']
52 52
 r_ground = cont.sensors["r_Ground"]
53 53
 #Sensor logic bricks connected to the python Controller  
54
-aXis = cont.sensors["sControla.001"]
55
-bUtt = cont.sensors["sControlb.001"]
54
+#aXis = cont.sensors["sControla.001"]
55
+#bUtt = cont.sensors["sControlb.001"]
56 56
 linvel = own.getLinearVelocity(True)
57 57
 lasta = own['lasta']
58 58
 lastx = own['lastx']
59 59
 last_sit = own['sit']
60
+dict = bge.logic.globalDict
60 61
 
61 62
 try:
62 63
     own['walk_timer'] = own['walk_timer'] +1
@@ -66,53 +67,53 @@ except:
66 67
 truckon = 30
67 68
 deckon = 30
68 69
 
69
-onW = onWindows()
70
+#onW = onWindows()
70 71
 
71 72
 # windows stuff
72
-lar_lts = 0
73
-uad_lts = 1
74
-lt = 4 if onW else 2
75
-lar_rts = 2 if onW else 3
76
-uad_rts = 3 if onW else 4
77
-rt = 5
73
+#lar_lts = 0
74
+#uad_lts = 1
75
+#lt = 4 if onW else 2
76
+#lar_rts = 2 if onW else 3
77
+#uad_rts = 3 if onW else 4
78
+#rt = 5
78 79
 
79
-a_but = 0 if onW else 0
80
-b_but = 1 if onW else 1
81
-x_but = 2 if onW else 2
82
-y_but = 3 if onW else 3
83
-l_bump = 9 if onW else 4
84
-r_bump = 10 if onW else 5
85
-bk_but = 4 if onW else 6
86
-st_but = 6 if onW else 7
87
-xb_but = 5 if onW else 8
88
-lts_pr = 7 if onW else 9
89
-rts_pr = 8 if onW else 10
90
-l_dp = 13 if onW else 11
91
-r_dp = 14 if onW else 12
92
-u_dp = 11 if onW else 13
93
-d_dp = 12 if onW else 14
80
+#a_but = 0 if onW else 0
81
+#b_but = 1 if onW else 1
82
+#x_but = 2 if onW else 2
83
+#y_but = 3 if onW else 3
84
+#l_bump = 9 if onW else 4
85
+#r_bump = 10 if onW else 5
86
+#bk_but = 4 if onW else 6
87
+#st_but = 6 if onW else 7
88
+#xb_but = 5 if onW else 8
89
+#lts_pr = 7 if onW else 9
90
+#rts_pr = 8 if onW else 10
91
+#l_dp = 13 if onW else 11
92
+#r_dp = 14 if onW else 12
93
+#u_dp = 11 if onW else 13
94
+#d_dp = 12 if onW else 14
94 95
 
95
-lLR = aXis.axisValues[lar_lts] / reduction
96
-lUD = aXis.axisValues[uad_lts] / reduction
97
-rLR = aXis.axisValues[lar_rts] / reduction
98
-rUD = aXis.axisValues[uad_rts] / reduction
99
-lTrig = aXis.axisValues[lt] / reduction
100
-rTrig = aXis.axisValues[rt] / reduction
101
-aBut = bUtt.getButtonStatus(a_but)
102
-bBut = bUtt.getButtonStatus(b_but)
103
-xBut = bUtt.getButtonStatus(x_but)
104
-yBut = bUtt.getButtonStatus(y_but)
105
-lBump = bUtt.getButtonStatus(l_bump)
106
-rBump = bUtt.getButtonStatus(r_bump)
107
-bkBut = bUtt.getButtonStatus(bk_but)
108
-stBut = bUtt.getButtonStatus(st_but)
109
-xbBut = bUtt.getButtonStatus(xb_but)
110
-ltsBut = bUtt.getButtonStatus(lts_pr)
111
-rtsBut = bUtt.getButtonStatus(rts_pr)
112
-ldPad = bUtt.getButtonStatus(l_dp)
113
-rdPad = bUtt.getButtonStatus(r_dp)
114
-udPad = bUtt.getButtonStatus(u_dp)
115
-ddPad = bUtt.getButtonStatus(d_dp)
96
+lLR = dict['lLR']
97
+lUD = dict['lUD']
98
+rLR = dict['rLR']
99
+rUD = dict['rUD']
100
+lTrig = dict['lTrig']
101
+rTrig = dict['rTrig']
102
+aBut = dict['aBut']
103
+bBut = dict['bBut']
104
+xBut = dict['xBut']
105
+yBut = dict['yBut']
106
+lBump = dict['lBump']
107
+rBump = dict['rBump']
108
+bkBut = dict['bkBut']
109
+stBut = dict['stBut']
110
+xbBut = dict['xbBut']
111
+ltsBut = dict['ltsBut']
112
+rtsBut = dict['rtsBut']
113
+ldPad = dict['ldPad']
114
+rdPad = dict['rdPad']
115
+udPad = dict['udPad']
116
+ddPad = dict['ddPad']
116 117
 
117 118
 #user
118 119
 sens = .04
@@ -120,15 +121,15 @@ fliplay = 30
120 121
 dropinCol = own.sensors['dropinCol']
121 122
 
122 123
 #no input
123
-def cutOff():
124
-    
125
- if (abs(lLR) < axisTh 
126
-     and abs(lUD) < axisTh 
127
-     and abs(rLR) < axisTh 
128
-     and abs(rUD) < axisTh
129
-     and aBut == False):
130
-         
131
-  return True
124
+#def cutOff():
125
+#    
126
+# if (abs(lLR) < axisTh 
127
+#     and abs(lUD) < axisTh 
128
+#     and abs(rLR) < axisTh 
129
+#     and abs(rUD) < axisTh
130
+#     and aBut == False):
131
+#         
132
+#  return True
132 133
 skater = scene.objects["Char4"]
133 134
 deck = scene.objects["deck"]
134 135
 trucks = scene.objects["trucks"]

Loading…
Cancel
Save