Browse Source

walk cleanup

shuvit 6 years ago
parent
commit
dc43aec0da
1 changed files with 19 additions and 226 deletions
  1. 19
    226
      walk.py

+ 19
- 226
walk.py View File

1
-#os = 'Windows'
2
-#from sys import platform
3
-#if platform != "win32":
4
- #os = 'Linux'
5
-def onWindows():
6
- return os == 'Windows'
1
+#shuvit.org
2
+#walk.py
3
+
7
 import bge
4
 import bge
8
 import GameLogic
5
 import GameLogic
9
 import ctypes
6
 import ctypes
15
 scene = bge.logic.getCurrentScene()
12
 scene = bge.logic.getCurrentScene()
16
 objList = scene.objects
13
 objList = scene.objects
17
 
14
 
18
-#reduction = 400000
19
-#axisTh = 0.03 
20
-
21
-############
22
-##vibration#
23
-############
24
-## Define necessary structures
25
-#class XINPUT_VIBRATION(ctypes.Structure):
26
-#    _fields_ = [("wLeftMotorSpeed", ctypes.c_ushort), ("wRightMotorSpeed", ctypes.c_ushort)]
27
-#xinput = ctypes.windll.xinput1_3 # Load Xinput.dll
28
-## Set up function argument types and return type
29
-#XInputSetState = xinput.XInputSetState
30
-#XInputSetState.argtypes = [ctypes.c_uint, ctypes.POINTER(XINPUT_VIBRATION)]
31
-#XInputSetState.restype = ctypes.c_uint
32
-## Now we're ready to call it. Set left motor to 100%, right motor to 50%
33
-## for controller 0
34
-##vibration = XINPUT_VIBRATION(65535, 32768)
35
-##XInputSetState(0, ctypes.byref(vibration))
36
-## You can also create a helper function like this:
37
-#def set_vibration(controller, left_motor, right_motor):
38
-#    vibration = XINPUT_VIBRATION(int(left_motor * 65535), int(right_motor * 65535))
39
-#    XInputSetState(controller, ctypes.byref(vibration))  
40
-## ... and use it like so
41
-##set_vibration(0, 0.2, 0.2)
42
-################
43
-##end vibration#
44
-################
45
-
46
-
47
 cont = GameLogic.getCurrentController() 
15
 cont = GameLogic.getCurrentController() 
48
 obj = bge.logic.getCurrentScene().objects
16
 obj = bge.logic.getCurrentScene().objects
49
 char = bge.constraints.getCharacter
17
 char = bge.constraints.getCharacter
51
 stance = own['stance']
19
 stance = own['stance']
52
 STANCE = own['stance']
20
 STANCE = own['stance']
53
 r_ground = cont.sensors["r_Ground"]
21
 r_ground = cont.sensors["r_Ground"]
54
-#Sensor logic bricks connected to the python Controller  
55
-#aXis = cont.sensors["sControla.001"]
56
-#bUtt = cont.sensors["sControlb.001"]
57
 linvel = own.getLinearVelocity(True)
22
 linvel = own.getLinearVelocity(True)
58
 lasta = own['lasta']
23
 lasta = own['lasta']
59
 lastx = own['lastx']
24
 lastx = own['lastx']
68
 truckon = 30
33
 truckon = 30
69
 deckon = 30
34
 deckon = 30
70
 
35
 
71
-#onW = onWindows()
72
-
73
-# windows stuff
74
-#lar_lts = 0
75
-#uad_lts = 1
76
-#lt = 4 if onW else 2
77
-#lar_rts = 2 if onW else 3
78
-#uad_rts = 3 if onW else 4
79
-#rt = 5
80
-
81
-#a_but = 0 if onW else 0
82
-#b_but = 1 if onW else 1
83
-#x_but = 2 if onW else 2
84
-#y_but = 3 if onW else 3
85
-#l_bump = 9 if onW else 4
86
-#r_bump = 10 if onW else 5
87
-#bk_but = 4 if onW else 6
88
-#st_but = 6 if onW else 7
89
-#xb_but = 5 if onW else 8
90
-#lts_pr = 7 if onW else 9
91
-#rts_pr = 8 if onW else 10
92
-#l_dp = 13 if onW else 11
93
-#r_dp = 14 if onW else 12
94
-#u_dp = 11 if onW else 13
95
-#d_dp = 12 if onW else 14
96
-
97
 lLR = dict['lLR']
36
 lLR = dict['lLR']
98
 lUD = dict['lUD']
37
 lUD = dict['lUD']
99
 rLR = dict['rLR']
38
 rLR = dict['rLR']
121
 fliplay = 30
60
 fliplay = 30
122
 dropinCol = own.sensors['dropinCol']
61
 dropinCol = own.sensors['dropinCol']
123
 
62
 
124
-#no input
125
-#def cutOff():
126
-#    
127
-# if (abs(lLR) < axisTh 
128
-#     and abs(lUD) < axisTh 
129
-#     and abs(rLR) < axisTh 
130
-#     and abs(rUD) < axisTh
131
-#     and aBut == False):
132
-#         
133
-#  return True
134
 skater = scene.objects["Char4"]
63
 skater = scene.objects["Char4"]
135
 deck = scene.objects["deck"]
64
 deck = scene.objects["deck"]
136
 trucks = scene.objects["trucks"]
65
 trucks = scene.objects["trucks"]
174
     for x in range(5000):
103
     for x in range(5000):
175
         if deck.isPlayingAction(x):
104
         if deck.isPlayingAction(x):
176
             print("deck is playing:", x)
105
             print("deck is playing:", x)
177
-#trucksisplaying() 
178
 
106
 
179
 def printplaying():
107
 def printplaying():
180
     splaying_layers = "S: "
108
     splaying_layers = "S: "
204
     #killact(11)
132
     #killact(11)
205
     killact(12)
133
     killact(12)
206
     killact(13)              
134
     killact(13)              
207
-######################################  
208
-#walk out
209
-#print(own['walk_timer'])
210
-#if own['walk_timer'] < 5:
211
-#    
212
-#    if stance == 0 and skater.isPlayingAction(fliplay) == False:
213
-#        
214
-#        if own['throw_deck'] == True:
215
-#            print("walk out1")
216
-#            skater.playAction("reg_nwalk_nb.001", 15,35, layer=29, play_mode=0, speed=.5)
217
-#        else:
218
-#            print("walk out2")
219
-#            skater.playAction("walk.000", 15,35, layer=29, play_mode=0, speed=.5)
220
-#        deck.playAction("a_reg_walk", 0,35, layer=17, play_mode=0)
221
-#        trucks.playAction("a_reg_walk", 0,35, layer=17, play_mode=0)    
222
-    
135
+######################################    
223
 
136
 
224
 #idle      
137
 #idle      
225
 if stance == 0 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
138
 if stance == 0 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
226
     own['requestAction'] = 'reg_idle'
139
     own['requestAction'] = 'reg_idle'
227
     if own['throw_deck'] == True:
140
     if own['throw_deck'] == True:
228
         own['requestAction'] = 'reg_idle_nb'
141
         own['requestAction'] = 'reg_idle_nb'
229
-        #skater.playAction("reg_idle1", 1,120, layer=3, play_mode=1, speed=.5)
230
-    #else:
231
-        #skater.playAction("reg_idle1", 1,120, layer=3, play_mode=1, speed=.5)
232
-        #deck.playAction("a_reg_idle1", 1,120, layer=3, play_mode=1, speed=.5)
233
-        #trucks.playAction("a_reg_idle1", 1,120, layer=3, play_mode=1, speed=.5) 
142
+
234
 if stance == 1 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
143
 if stance == 1 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
235
     own['requestAction'] = 'fak_idle'
144
     own['requestAction'] = 'fak_idle'
236
     if own['throw_deck'] == True:
145
     if own['throw_deck'] == True:
237
         own['requestAction'] = 'fak_idle_nb'
146
         own['requestAction'] = 'fak_idle_nb'
238
-        #skater.playAction("fak_idle1", 1,120, layer=3, play_mode=1, speed=.5)
239
-    #else:
240
-        #skater.playAction("fak_idle1", 1,120, layer=3, play_mode=1, speed=.5)
241
-        #deck.playAction("a_fak_idle1", 1,120, layer=3, play_mode=1, speed=.5)
242
-        #trucks.playAction("a_fak_idle1", 1,120, layer=3, play_mode=1, speed=.5) 
243
 
147
 
244
 if lUD < -sens:
148
 if lUD < -sens:
245
     lup = 1
149
     lup = 1
253
 #walking
157
 #walking
254
 
158
 
255
 #new walking
159
 #new walking
256
-#if (lup == 1 and aBut == 0 and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0):
257
 vel = own.getLinearVelocity(True)
160
 vel = own.getLinearVelocity(True)
258
 if own['walk_timer'] < 50:
161
 if own['walk_timer'] < 50:
259
     velx = vel.x * .95             
162
     velx = vel.x * .95             
310
     own.actuators["walkondirt"].volume = .2
213
     own.actuators["walkondirt"].volume = .2
311
     own.actuators["walkondirt"].pitch = 1
214
     own.actuators["walkondirt"].pitch = 1
312
     cont.activate(own.actuators["walkondirt"])
215
     cont.activate(own.actuators["walkondirt"])
313
-    if lasta == 1:
314
-        #cont.deactivate(own.actuators['forward2']) 
315
-        #cont.deactivate(own.actuators['backward2'])
316
-        killact(6)
317
-        killact(7)
318
-        killact(8)
319
-        killact(9)
320
-        killact(17)
321
-        killact(18)                
216
+                
322
     if stance == 0 and skater.isPlayingAction(fliplay) == False:             
217
     if stance == 0 and skater.isPlayingAction(fliplay) == False:             
323
-        #cont.activate(own.actuators['forward'])
324
-        #cont.activate(skater.actuators['aWalk'])
325
-        #cont.activate(deck.actuators['a_reg_walk'])
326
-        #cont.activate(deck.actuators['a_reg_walk'])
327
         #without deck
218
         #without deck
328
         if own['throw_deck'] == True:
219
         if own['throw_deck'] == True:
329
             own['requestAction'] = 'reg_walk_nb'
220
             own['requestAction'] = 'reg_walk_nb'
330
-            #skater.playAction("reg_nwalk_nb.001", 0,35, layer=24, play_mode=1, speed=.5)
331
         else:
221
         else:
332
             own['requestAction'] = 'reg_walk'
222
             own['requestAction'] = 'reg_walk'
333
-#            skater.playAction("reg_nwalk", 0,35, layer=24, play_mode=1, speed=.5)
334
-#        deck.playAction("a_reg_nwalk", 0,35, layer=16, play_mode=1, speed=.5)
335
-#        trucks.playAction("a_reg_nwalk", 0,35, layer=16, play_mode=1, speed=.5)
336
-        killact(25) 
337
-        killact(305)
338
-        killact(306)                
223
+               
339
     if stance == 1 and skater.isPlayingAction(fliplay) == False:        
224
     if stance == 1 and skater.isPlayingAction(fliplay) == False:        
340
-        #cont.activate(own.actuators['backward'])
341
-        #cont.activate(skater.actuators['aWalk_fak'])
342
-        #cont.activate(deck.actuators['a_fak_walk'])
343
-        #cont.activate(trucks.actuators['a_fak_walk'])
344
         #without deck
225
         #without deck
345
         if own['throw_deck'] == True:
226
         if own['throw_deck'] == True:
346
             own['requestAction'] = 'fak_walk_nb'
227
             own['requestAction'] = 'fak_walk_nb'
347
-            #skater.playAction("fak_nwalk_nb.001", 0,35, layer=25, play_mode=1, speed=.5)
348
         else:
228
         else:
349
             own['requestAction'] = 'fak_walk'
229
             own['requestAction'] = 'fak_walk'
350
-#            skater.playAction("fak_nwalk", 0,35, layer=25, play_mode=1, speed=.5)    
351
-#        deck.playAction("a_fak_nwalk", 0,35, layer=15, play_mode=1, speed=.5)
352
-#        trucks.playAction("a_fak_nwalk", 0,35, layer=15, play_mode=1, speed=.5)        
230
+       
353
 elif lup == 1 and aBut == 1 and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
231
 elif lup == 1 and aBut == 1 and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
354
     own.actuators["walkondirt"].volume = .2
232
     own.actuators["walkondirt"].volume = .2
355
     own.actuators["walkondirt"].pitch = 1.3
233
     own.actuators["walkondirt"].pitch = 1.3
356
     cont.activate(own.actuators["walkondirt"])
234
     cont.activate(own.actuators["walkondirt"])
357
     if stance == 0 and skater.isPlayingAction(fliplay) == False:        
235
     if stance == 0 and skater.isPlayingAction(fliplay) == False:        
358
-        #cont.activate(own.actuators['forward2'])
359
-        #cont.activate(skater.actuators['aWalk'])
360
         if own['throw_deck'] == True:
236
         if own['throw_deck'] == True:
361
             own['requestAction'] = 'reg_walkFast_nb'
237
             own['requestAction'] = 'reg_walkFast_nb'
362
             skater.playAction("reg_nwalk_nb.001", 0,35, layer=25, play_mode=1, speed=1)
238
             skater.playAction("reg_nwalk_nb.001", 0,35, layer=25, play_mode=1, speed=1)
363
         else:
239
         else:
364
             own['requestAction'] = 'reg_walkFast'
240
             own['requestAction'] = 'reg_walkFast'
365
-#            skater.playAction("reg_nwalk", 0,35, layer=25, play_mode=1, speed=1)         
366
-#        
367
-#        deck.playAction("a_reg_nwalk", 0,35, layer=305, play_mode=1, speed=1)
368
-#        trucks.playAction("a_reg_nwalk", 0,35, layer=306, play_mode=1, speed=1)
241
+
369
     else:
242
     else:
370
         killact(25) 
243
         killact(25) 
371
         killact(305)
244
         killact(305)
372
         killact(306)           
245
         killact(306)           
373
     if stance == 1 and skater.isPlayingAction(fliplay) == False:        
246
     if stance == 1 and skater.isPlayingAction(fliplay) == False:        
374
-        #cont.activate(own.actuators['backward2'])
375
-        #cont.activate(skater.actuators['aWalk_fak'])
376
         if own['throw_deck'] == True:
247
         if own['throw_deck'] == True:
377
             own['requestAction'] = 'fak_walkFast_nb'
248
             own['requestAction'] = 'fak_walkFast_nb'
378
             skater.playAction("fak_nwalk_nb.001", 0,35, layer=24, play_mode=1, speed=1)           
249
             skater.playAction("fak_nwalk_nb.001", 0,35, layer=24, play_mode=1, speed=1)           
379
         else:
250
         else:
380
-            own['requestAction'] = 'fak_walkFast'
381
-#            skater.playAction("fak_nwalk", 0,35, layer=24, play_mode=1, speed=1)                       
382
-#        deck.playAction("a_fak_nwalk", 0,35, layer=15, play_mode=1, speed=1)
383
-#        trucks.playAction("a_fak_nwalk", 0,35, layer=15, play_mode=1, speed=1)             
251
+            own['requestAction'] = 'fak_walkFast'             
384
 else:
252
 else:
385
     vel = own.getLinearVelocity(True)
253
     vel = own.getLinearVelocity(True)
386
     cont.deactivate(own.actuators["walkondirt"])
254
     cont.deactivate(own.actuators["walkondirt"])
387
     if stance == 0:
255
     if stance == 0:
388
-        #cont.deactivate(own.actuators['forward'])
389
-        #cont.deactivate(own.actuators['forward2'])
390
         cont.deactivate(skater.actuators['aWalk'])
256
         cont.deactivate(skater.actuators['aWalk'])
391
         cont.deactivate(deck.actuators['a_reg_walk'])
257
         cont.deactivate(deck.actuators['a_reg_walk'])
392
         cont.deactivate(trucks.actuators['a_reg_walk'])        
258
         cont.deactivate(trucks.actuators['a_reg_walk'])        
393
-        killact(4)
394
-        killact(5)
395
-        killact(6)
396
-        killact(7)
397
-        killact(15)
398
-        killact(16)
399
-        killact(17)
400
-        killact(18)
401
-        killact(24)
402
-        killact(25) 
403
-        killact(305)
404
-        killact(306)         
405
-#        if own['walk_timer'] < 50:
406
-#            velx = vel.x * .95             
407
-#            #own.setLinearVelocity([velx, 0, vel.z], True)
408
-#            
409
-#        else:
410
-#            if r_ground.triggered:
411
-#                own.setLinearVelocity([0, 0, vel.z], True)
412
-#            #velz = vel.z
413
-#            #print(velz)
414
-#            #own.localLinearVelocity[0, 0, velz]
259
+
415
     if stance == 1:
260
     if stance == 1:
416
-        #cont.deactivate(own.actuators['backward'])
417
-        #cont.deactivate(own.actuators['backward2'])
418
         cont.deactivate(skater.actuators['aWalk_fak'])
261
         cont.deactivate(skater.actuators['aWalk_fak'])
419
         cont.deactivate(deck.actuators['a_fak_walk'])
262
         cont.deactivate(deck.actuators['a_fak_walk'])
420
         cont.deactivate(trucks.actuators['a_fak_walk'])        
263
         cont.deactivate(trucks.actuators['a_fak_walk'])        
421
-        killact(4)
422
-        killact(5)
423
-        killact(6)
424
-        killact(7)
425
-        killact(15)
426
-        killact(16)
427
-        killact(17)
428
-        killact(18)
429
-        killact(24)
430
-        killact(25) 
431
-        killact(305)
432
-        killact(306)             
433
-#        if own['walk_timer'] < 50:
434
-#            velx = vel.x * .95             
435
-#            #own.setLinearVelocity([velx, 0, vel.z], True)
436
-#        else:
437
-#            own.setLinearVelocity([0, 0, vel.z], True)
264
+
438
 #in air        
265
 #in air        
439
 if lup == 1 and r_ground.positive == False:
266
 if lup == 1 and r_ground.positive == False:
440
     
267
     
448
         killact(7)        
275
         killact(7)        
449
         velx = linvel.x - 1
276
         velx = linvel.x - 1
450
         own.setLinearVelocity([-1.5, linvel.y, linvel.z], 1)
277
         own.setLinearVelocity([-1.5, linvel.y, linvel.z], 1)
451
-        #cont.activate(own.actuators['forward2'])
452
     if stance == 1:    
278
     if stance == 1:    
453
         cont.deactivate(own.actuators['backward'])
279
         cont.deactivate(own.actuators['backward'])
454
         cont.deactivate(own.actuators['backward2'])
280
         cont.deactivate(own.actuators['backward2'])
458
         killact(6)
284
         killact(6)
459
         killact(7)        
285
         killact(7)        
460
         velx = linvel.x + 1
286
         velx = linvel.x + 1
461
-        own.setLinearVelocity([1.5, linvel.y, linvel.z], 1) 
462
-        #cont.activate(own.actuators['backward2'])       
287
+        own.setLinearVelocity([1.5, linvel.y, linvel.z], 1)       
463
 #---------------
288
 #---------------
464
 if rLR > .05:
289
 if rLR > .05:
465
     cont.activate(camobj.actuators['camRight'])
290
     cont.activate(camobj.actuators['camRight'])
510
         fliplay3 = 303
335
         fliplay3 = 303
511
         try:
336
         try:
512
             vel = own['offboard_vel']
337
             vel = own['offboard_vel']
513
-            #velx = vel.x *2
514
-            vel = [velx, vel.y, vel.z]
515
-            #vel = vel * 4
516
-            #vel = [-100, 0, 0]
517
-            #print(vel)
518
-            #own.localLinearVelocity = vel
519
-            #JUMPHEIGHT = 1100
520
-            #force = [600, 0.0, 10]
521
-            # use local axis
522
-            #local = True
523
-            # apply force
524
-            #own.applyForce(force, local)            
338
+            vel = [velx, vel.y, vel.z]           
525
         except: 
339
         except: 
526
             pass
340
             pass
527
          
341
          
533
             deck.stopAction(deckon)
347
             deck.stopAction(deckon)
534
             trucks.stopAction(truckon)
348
             trucks.stopAction(truckon)
535
             own['requestAction'] = 'reg_offboard'             
349
             own['requestAction'] = 'reg_offboard'             
536
-
537
-#            skater.playAction("reg_noffboard", 0,26, layer=fliplay, priority=0, play_mode=0, speed=.5)
538
-#            deck.playAction("a_reg_noffboard", 0,26, layer=deckon, priority=0, play_mode=0, speed=.5)
539
-#            trucks.playAction("a_reg_noffboard", 0,26, layer=truckon, priority=0, play_mode=0, speed=.5)            
350
+            
540
         if STANCE == 1:
351
         if STANCE == 1:
541
             killact(3)
352
             killact(3)
542
             killact(4)
353
             killact(4)
544
             skater.stopAction(fliplay)
355
             skater.stopAction(fliplay)
545
             deck.stopAction(deckon)
356
             deck.stopAction(deckon)
546
             trucks.stopAction(truckon)
357
             trucks.stopAction(truckon)
547
-            own['requestAction'] = 'fak_offboard'             
548
-#            skater.playAction("nfak_offboard", 1,30, layer=fliplay, priority=0, play_mode=0, speed=1.5)
549
-#            deck.playAction("a_fak_offboard", 1,30, layer=deckon, priority=0, play_mode=0, speed=1.5)
550
-#            trucks.playAction("a_fak_offboard", 1,30, layer=truckon, priority=0, play_mode=0, speed=1.5)             
358
+            own['requestAction'] = 'fak_offboard'                          
551
 def jump():
359
 def jump():
552
     if xBut == True:
360
     if xBut == True:
553
         if own['lastx'] == 0:
361
         if own['lastx'] == 0:
555
             killact(4)
363
             killact(4)
556
             killact(5)
364
             killact(5)
557
             killact(6)
365
             killact(6)
558
-            killact(7) 
559
-            #why does this layer have to be so high?      
366
+            killact(7)      
560
             if STANCE == 0:  
367
             if STANCE == 0:  
561
                 own['requestAction'] ='reg_jump'   
368
                 own['requestAction'] ='reg_jump'   
562
-#                skater.playAction("reg_jump", 1,35, layer=400, priority=0, play_mode=0, speed=.5)
563
-#                deck.playAction("a_reg_jump2", 1,35, layer=400, priority=0, play_mode=0, speed=.5)
564
-#                trucks.playAction("a_reg_jump2", 1,35, layer=400, priority=0, play_mode=0, speed=.5)
565
             if STANCE == 1:
369
             if STANCE == 1:
566
-                own['requestAction'] ='fak_jump'
567
-                #skater.playAction("fak_jump", 1,35, layer=400, priority=0, play_mode=0, speed=.5)    
568
-            #deck.playAction("a_reg_jump", 1,30, layer=11, play_mode=0, speed=.5)
569
-            #trucks.playAction("a_reg_jump", 1,30, layer=12, priority=0, play_mode=0, speed=1)             
370
+                own['requestAction'] ='fak_jump'             
570
             JUMPHEIGHT = 1100
371
             JUMPHEIGHT = 1100
571
             force = [ 0.0, 0.0, JUMPHEIGHT]
372
             force = [ 0.0, 0.0, JUMPHEIGHT]
572
             # use local axis
373
             # use local axis
578
         own['lastx'] = 0
379
         own['lastx'] = 0
579
 def dropin():
380
 def dropin():
580
     if dropinCol.positive == True:
381
     if dropinCol.positive == True:
581
-        #print("DROPIN") 
582
         pass       
382
         pass       
583
         
383
         
584
 def getonboard():
384
 def getonboard():
982
         own['sit'] = 0
782
         own['sit'] = 0
983
 
783
 
984
     if aBut == False and lasta == True:
784
     if aBut == False and lasta == True:
985
-        #print(lasta)
986
         try:
785
         try:
987
-            #print(r_ground.hitObject)
988
             if 'sit' in r_ground.hitObject:
786
             if 'sit' in r_ground.hitObject:
989
                 print("sit")
787
                 print("sit")
990
                 own['sit'] = 1
788
                 own['sit'] = 1
998
                     skater.playAction("fak_sit", 1,65, layer=300, play_mode=0, speed=1)
796
                     skater.playAction("fak_sit", 1,65, layer=300, play_mode=0, speed=1)
999
                     deck.playAction("a_fak_sit", 1,65, layer=300, play_mode=0, speed=1)
797
                     deck.playAction("a_fak_sit", 1,65, layer=300, play_mode=0, speed=1)
1000
                     trucks.playAction("a_fak_sit", 1,65, layer=300, play_mode=0, speed=1)                                         
798
                     trucks.playAction("a_fak_sit", 1,65, layer=300, play_mode=0, speed=1)                                         
1001
-    #if own['sit'] == 1 and last_sit == 0:
1002
-                 
1003
-                     
1004
-                
1005
         except:
799
         except:
1006
-            #print("sit broke")
1007
             pass    
800
             pass    
1008
     if own['sit'] == 1:
801
     if own['sit'] == 1:
1009
         try:
802
         try:
1271
 else:
1064
 else:
1272
     cont.activate(own.actuators["walk_align"])                    
1065
     cont.activate(own.actuators["walk_align"])                    
1273
 
1066
 
1067
+#walking on stairs
1274
 if r_ground.triggered:
1068
 if r_ground.triggered:
1275
-    #print("on stair")
1276
     try:
1069
     try:
1277
         if 'stair' in r_ground.hitObject:
1070
         if 'stair' in r_ground.hitObject:
1278
             own['stair_counter'] = 20
1071
             own['stair_counter'] = 20

Loading…
Cancel
Save