shuvit преди 6 години
родител
ревизия
fbccd177c6
променени са 4 файла, в които са добавени 89 реда и са изтрити 27 реда
  1. 6
    0
      Manager.py
  2. 29
    1
      co_ActionState.py
  3. 13
    4
      controller2.py
  4. 41
    22
      walk.py

+ 6
- 0
Manager.py Целия файл

@@ -126,6 +126,12 @@ def main():
126 126
             own["playbackBroken"] = False
127 127
             freecam.worldPosition = own.worldPosition
128 128
             followcam.worldPosition = own.worldPosition
129
+            cube['grindcement_vol'] = 0
130
+            cube['grindcement_pitch'] = 0
131
+            cube['grindrail_vol'] = 0
132
+            cube['grindrail_pitch'] = 0 
133
+            cube['sroll_vol'] = 0
134
+            cube['sroll_pitch'] = 0             
129 135
             
130 136
 
131 137
         if own["playback"]:

+ 29
- 1
co_ActionState.py
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 13
- 4
controller2.py Целия файл

@@ -160,6 +160,7 @@ def main():
160 160
     if r_ground.triggered: own['wallride_off'] = 0
161 161
     own['pop_sound'] = 0
162 162
     own['land_sound'] = 0
163
+    own['revert_sound'] = 0
163 164
     #own['fall'] = 0 
164 165
 
165 166
     #joystick location timers
@@ -310,6 +311,10 @@ def main():
310 311
         if r_ground.triggered == True and skater.isPlayingAction(fliplay) and own['jump_timer'] < 40 and playing_frame < 14 and playing_frame > 3:
311 312
             own['fall'] = 1
312 313
             print("fall: ", playing_frame, own['jump_timer'])
314
+            if STANCE == 0:
315
+                own['requestAction'] = 'reg_fall1'
316
+            if STANCE == 1:
317
+                own['requestAction'] = 'fak_fall1'                
313 318
     check_fall()
314 319
     def check_landing():
315 320
         lf_ground = own["lF_ground"]
@@ -2416,7 +2421,8 @@ def main():
2416 2421
         else:
2417 2422
             own['requestAction'] = 'revert1'            
2418 2423
         own['revert_timer'] = 20 
2419
-        cont.activate(own.actuators["revertSound"])      
2424
+        cont.activate(own.actuators["revertSound"]) 
2425
+        own['revert_sound'] = 1     
2420 2426
     def revert2():
2421 2427
         own["Q3oncdl"] = 0
2422 2428
         own["Q4oncdl"] = 0
@@ -2441,7 +2447,8 @@ def main():
2441 2447
         else:     
2442 2448
             own['requestAction'] = 'revert2'       
2443 2449
         own['revert_timer'] = 20 
2444
-        cont.activate(own.actuators["revertSound"])         
2450
+        cont.activate(own.actuators["revertSound"])   
2451
+        own['revert_sound'] = 1      
2445 2452
     def revert3():
2446 2453
         own["Q7oncdl"] = 0
2447 2454
         own["Q8oncdl"] = 0
@@ -2467,7 +2474,8 @@ def main():
2467 2474
         else:       
2468 2475
             own['requestAction'] = 'revert3' 
2469 2476
         own['revert_timer'] = 20 
2470
-        cont.activate(own.actuators["revertSound"])      
2477
+        cont.activate(own.actuators["revertSound"]) 
2478
+        own['revert_sound'] = 1     
2471 2479
     def revert4():
2472 2480
         own["Q7oncdl"] = 0
2473 2481
         own["Q8oncdl"] = 0
@@ -2493,7 +2501,8 @@ def main():
2493 2501
             own['requestAction'] = 'revert4'
2494 2502
             print("normal revert")        
2495 2503
         own['revert_timer'] = 20 
2496
-        cont.activate(own.actuators["revertSound"])       
2504
+        cont.activate(own.actuators["revertSound"]) 
2505
+        own['revert_sound'] = 1      
2497 2506
 
2498 2507
     def powerslide():
2499 2508
         own['powerslide_counter'] = own['powerslide_counter'] + 1

+ 41
- 22
walk.py Целия файл

@@ -332,6 +332,12 @@ def onboard():
332 332
         fliplay = 301
333 333
         fliplay2 = 302 
334 334
         fliplay3 = 303
335
+        own['grindcement_vol'] = 0
336
+        own['grindcement_pitch'] = 0
337
+        own['grindrail_vol'] = 0
338
+        own['grindrail_pitch'] = 0 
339
+        own['sroll_vol'] = 0
340
+        own['sroll_pitch'] = 0                 
335 341
         try:
336 342
             vel = own['offboard_vel']
337 343
             vel = [velx, vel.y, vel.z]           
@@ -398,27 +404,7 @@ def getonboard():
398 404
         #camera.max = 1.25
399 405
         #cont.activate(cam.actuators['Camera']) 
400 406
         
401
-        deckact = deck.actuators["Visibility"]
402
-        trucksact = trucks.actuators["Visibility"]
403
-        wheel1act = wheel1.actuators["Visibility"]
404
-        wheel2act = wheel2.actuators["Visibility"]
405
-        wheel3act = wheel3.actuators["Visibility"]
406
-        wheel4act = wheel4.actuators["Visibility"]        
407
-        deckact.visibility = True
408
-        trucksact.visibility = True
409
-        wheel1act.visibility = True
410
-        wheel2act.visibility = True
411
-        wheel3act.visibility = True
412
-        wheel4act.visibility = True  
413
-        cont.activate(deck.actuators['Visibility'])
414
-        cont.activate(trucks.actuators['Visibility'])
415
-        cont.activate(wheel1.actuators['Visibility'])
416
-        cont.activate(wheel2.actuators['Visibility'])
417
-        cont.activate(wheel3.actuators['Visibility'])
418
-        cont.activate(wheel4.actuators['Visibility']) 
419
-        own['throw_deck'] = False 
420
-        throw_deck_empty = scene.objects["throw_deck_empty"]
421
-        throw_deck_empty['kill_deck'] = 1 
407
+
422 408
         fliplay3 = fliplay2 + 1 
423 409
         if dropinCol.positive == True: 
424 410
                        
@@ -482,7 +468,30 @@ def getonboard():
482 468
         fliplay3 = 6000 
483 469
         onboard_speed = .1                                      
484 470
         own['getonboard'] = 0 
485
-    if yBut == False and lasty == True:
471
+    if (yBut == False and lasty == True) or yBut == True and dropinCol.positive:
472
+        
473
+        deckact = deck.actuators["Visibility"]
474
+        trucksact = trucks.actuators["Visibility"]
475
+        wheel1act = wheel1.actuators["Visibility"]
476
+        wheel2act = wheel2.actuators["Visibility"]
477
+        wheel3act = wheel3.actuators["Visibility"]
478
+        wheel4act = wheel4.actuators["Visibility"]        
479
+        deckact.visibility = True
480
+        trucksact.visibility = True
481
+        wheel1act.visibility = True
482
+        wheel2act.visibility = True
483
+        wheel3act.visibility = True
484
+        wheel4act.visibility = True  
485
+        cont.activate(deck.actuators['Visibility'])
486
+        cont.activate(trucks.actuators['Visibility'])
487
+        cont.activate(wheel1.actuators['Visibility'])
488
+        cont.activate(wheel2.actuators['Visibility'])
489
+        cont.activate(wheel3.actuators['Visibility'])
490
+        cont.activate(wheel4.actuators['Visibility']) 
491
+        own['throw_deck'] = False 
492
+        throw_deck_empty = scene.objects["throw_deck_empty"]
493
+        throw_deck_empty['kill_deck'] = 1 
494
+    if (yBut == False and lasty == True):               
486 495
         own['getonboard'] = 1       
487 496
 
488 497
 def nextframe():
@@ -745,9 +754,12 @@ def throwdeck_trigger():
745 754
 def fall():
746 755
     if own['fall'] == True:
747 756
         falldeck()
757
+        
748 758
         if STANCE == 1:
759
+            own['requestAction'] = 'fak_fall1'
749 760
             own.setLinearVelocity([3,2,0], True)
750 761
         else:
762
+            own['requestAction'] = 'reg_fall1'
751 763
             own.setLinearVelocity([-3,-2,0], True)    
752 764
         own['fall'] = False
753 765
 
@@ -1078,6 +1090,13 @@ if deck.visible:
1078 1090
     own['deckvis'] = 1
1079 1091
 else:
1080 1092
     own['deckvis'] = 0       
1093
+
1094
+if own['requestAction'] == 'empty' or own['requestAction'] == None:
1095
+    if STANCE == 0:
1096
+        own['requestAction'] = 'reg_idle1'
1097
+    if STANCE == 1:
1098
+        own['requestAction'] = 'fak_idle1'        
1099
+    
1081 1100
                     
1082 1101
 onboard() 
1083 1102
 jump()

Loading…
Отказ
Запис