shuvit il y a 6 ans
Parent
révision
ac673f95ec
4 fichiers modifiés avec 109 ajouts et 38 suppressions
  1. 66
    31
      co_ActionState.py
  2. 38
    4
      controller2.py
  3. 3
    3
      grindV2.py
  4. 2
    0
      pause.py

+ 66
- 31
co_ActionState.py Voir le fichier

33
         queueAction = own['queueAction']
33
         queueAction = own['queueAction']
34
         actionTimer = own['actionTimer']
34
         actionTimer = own['actionTimer']
35
     except:
35
     except:
36
-        print("init")
37
-        own['actionState'] = 'empty'
36
+        #print("init")
37
+        own['actionState'] = 'reg_walk'
38
         own['l_actionState'] = 'empty'        
38
         own['l_actionState'] = 'empty'        
39
-        own['requestAction'] = 'empty'    
39
+        own['requestAction'] = 'reg_walk'    
40
         own['l_requestAction'] = 'empty'
40
         own['l_requestAction'] = 'empty'
41
         own['queueAction'] = 'empty'
41
         own['queueAction'] = 'empty'
42
         own['actionTimer'] = 0
42
         own['actionTimer'] = 0
43
+        own['clear_request'] = 0
43
         actionTimer = 0
44
         actionTimer = 0
44
         queueAction = 'empty'
45
         queueAction = 'empty'
45
-        requestAction = 'empty'
46
+        requestAction = 'reg_walk'
46
         actionState = 'empty'
47
         actionState = 'empty'
47
         l_actionState = 'empty'
48
         l_actionState = 'empty'
48
         l_requestAction = 'empty'
49
         l_requestAction = 'empty'
54
     transPlaying = skater.isPlayingAction(trans_layer)
55
     transPlaying = skater.isPlayingAction(trans_layer)
55
     #if isplaying  == False:    
56
     #if isplaying  == False:    
56
         #own['actionTimer'] = 0
57
         #own['actionTimer'] = 0
58
+        
59
+    if own['clear_request'] == 1:
60
+        requestAction = 'empty'
61
+        own['clear_request'] = 0    
57
     if own['actionTimer'] != 0 and transPlaying == False and isplaying == False:
62
     if own['actionTimer'] != 0 and transPlaying == False and isplaying == False:
58
         own['actionTimer'] = 0
63
         own['actionTimer'] = 0
59
         actionTimer = 0
64
         actionTimer = 0
133
             
138
             
134
     #check last actionState to see if an out action is needed
139
     #check last actionState to see if an out action is needed
135
     
140
     
136
-    elif requestAction not in jump_overrideList:
141
+    if requestAction not in jump_overrideList:
137
         if l_actionState == 'reg_turnRight' and requestAction != 'reg_turnRight':
142
         if l_actionState == 'reg_turnRight' and requestAction != 'reg_turnRight':
138
             requestAction = 'reg_turnRight_out'
143
             requestAction = 'reg_turnRight_out'
139
             actionState = 'reg_turnRight_out'
144
             actionState = 'reg_turnRight_out'
160
             requestAction = 'fak_nopos_out'
165
             requestAction = 'fak_nopos_out'
161
             actionState = 'fak_nopos_out' 
166
             actionState = 'fak_nopos_out' 
162
             
167
             
168
+#        if l_actionState == 'reg_pump_out_hold' and requestAction != 'reg_pump' and requestAction not in pump_out_overList:
169
+#            requestAction = 'reg_pump_out'
170
+#            actionState = 'reg_pump_out' 
171
+            
172
+            
163
         if l_actionState == 'reg_pump' and requestAction != 'reg_pump' and requestAction not in pump_out_overList:
173
         if l_actionState == 'reg_pump' and requestAction != 'reg_pump' and requestAction not in pump_out_overList:
164
             requestAction = 'reg_pump_out'
174
             requestAction = 'reg_pump_out'
165
             actionState = 'reg_pump_out' 
175
             actionState = 'reg_pump_out' 
176
+            
177
+            
178
+                        
179
+#        if l_actionState == 'fak_pump_out_hold' and requestAction != 'fak_pump' and requestAction not in pump_out_overList:
180
+#            requestAction = 'fak_pump_out'
181
+#            actionState = 'fak_pump_out'
182
+            
166
         if l_actionState == 'fak_pump' and requestAction != 'fak_pump' and requestAction not in pump_out_overList:
183
         if l_actionState == 'fak_pump' and requestAction != 'fak_pump' and requestAction not in pump_out_overList:
167
             requestAction = 'fak_pump_out'
184
             requestAction = 'fak_pump_out'
168
-            actionState = 'fak_pump_out'
185
+            actionState = 'fak_pump_out'            
186
+            
187
+            
169
         if l_actionState == 'reg_powerslide' and requestAction != 'reg_powerslide':
188
         if l_actionState == 'reg_powerslide' and requestAction != 'reg_powerslide':
170
             requestAction = 'reg_powerslide_out'
189
             requestAction = 'reg_powerslide_out'
171
             actionState = 'reg_powerslide_out' 
190
             actionState = 'reg_powerslide_out' 
478
                     
497
                     
479
                     own['actionTimer'] = cur_frame
498
                     own['actionTimer'] = cur_frame
480
                 else:                      
499
                 else:                      
481
-                    skater.playAction("nreg_pump_in", 10,1, layer=trans_layer, play_mode=0, speed=.5)
482
-                    deck.playAction("a_reg", 1,40, layer=trans_layer, play_mode=1, speed=.5)
483
-                    trucks.playAction("a_reg", 1,40, layer=trans_layer, play_mode=1, speed=.5)
500
+                    skater.playAction("nreg_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=.5)
501
+                    deck.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
502
+                    trucks.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
503
+                    
504
+#            if requestAction == 'reg_pump_out_hold':
505
+#                actionState = 'reg_pump_out_hold'
506
+#                own['actionTimer'] = 19
507
+#                skater.playAction("nreg_pump_in", 10,10, layer=trans_layer, play_mode=0, speed=.5)
508
+#                deck.playAction("a_reg", 10,10, layer=trans_layer, play_mode=1, speed=.5)
509
+#                trucks.playAction("a_reg", 10,10, layer=trans_layer, play_mode=1, speed=.5)                    
484
                     
510
                     
485
             if requestAction == 'fak_pump_out':
511
             if requestAction == 'fak_pump_out':
486
                 actionState = 'fak_pump_out'
512
                 actionState = 'fak_pump_out'
495
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=1, speed=.5)
521
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=1, speed=.5)
496
                     own['actionTimer'] = cur_frame
522
                     own['actionTimer'] = cur_frame
497
                 else:                      
523
                 else:                      
498
-                    skater.playAction("nfak_pump_in", 10,1, layer=trans_layer, play_mode=0, speed=.5)
499
-                    deck.playAction("a_reg", 10,1, layer=trans_layer, play_mode=1, speed=.5)
500
-                    trucks.playAction("a_reg", 10,1, layer=trans_layer, play_mode=1, speed=.5)
524
+                    skater.playAction("nfak_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=.5)
525
+                    deck.playAction("a_reg", 20,1, layer=trans_layer, play_mode=1, speed=.5)
526
+                    trucks.playAction("a_reg", 20,1, layer=trans_layer, play_mode=1, speed=.5)
527
+#            if requestAction == 'fak_pump_out_hold':
528
+#                actionState = 'fak_pump_out_hold'
529
+#                own['actionTimer'] = 19
530
+#                skater.playAction("nfak_pump_in", 10,10, layer=trans_layer, play_mode=0, speed=.5)
531
+#                deck.playAction("a_reg", 10,10, layer=trans_layer, play_mode=1, speed=.5)
532
+#                trucks.playAction("a_reg", 10,10, layer=trans_layer, play_mode=1, speed=.5)                          
501
 
533
 
502
             if requestAction == 'reg_stop_out':
534
             if requestAction == 'reg_stop_out':
503
                 actionState = 'reg_stop_out'
535
                 actionState = 'reg_stop_out'
2367
                     # skater.playAction("reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)
2399
                     # skater.playAction("reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)
2368
                     # deck.playAction("a_reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)
2400
                     # deck.playAction("a_reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)
2369
                     # trucks.playAction("a_reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)        
2401
                     # trucks.playAction("a_reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)        
2370
-                    skater.playAction("reg_nmanual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                
2371
-                    deck.playAction("a_fak_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)
2372
-                    trucks.playAction("a_fak_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                        
2402
+                    skater.playAction("reg_noseg.002", 5,5, layer=trans_layer, play_mode=0, speed=.5)                
2403
+                    deck.playAction("a_reg_noseg.002", 5,5, layer=trans_layer, play_mode=0, speed=.5)
2404
+                    trucks.playAction("a_reg_noseg.002", 5,5, layer=trans_layer, play_mode=0, speed=.5)                        
2373
                 else:
2405
                 else:
2374
                     #pass
2406
                     #pass
2375
                     # skater.playAction("reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2407
                     # skater.playAction("reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2376
                     # deck.playAction("a_reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2408
                     # deck.playAction("a_reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2377
                     # trucks.playAction("a_reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2409
                     # trucks.playAction("a_reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2378
-                    skater.playAction("reg_nmanual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                
2379
-                    deck.playAction("a_fak_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)
2380
-                    trucks.playAction("a_fak_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                     
2410
+                    skater.playAction("reg_noseg.002", 5,5, layer=loop_layer, play_mode=1, speed=.5)                
2411
+                    deck.playAction("a_reg_noseg.002", 5,5, layer=loop_layer, play_mode=1, speed=.5)
2412
+                    trucks.playAction("a_reg_noseg.002", 5,5, layer=loop_layer, play_mode=1, speed=.5)                     
2381
             if requestAction == 'fak_air_nose':
2413
             if requestAction == 'fak_air_nose':
2382
                 actionState = 'fak_air_nose'
2414
                 actionState = 'fak_air_nose'
2383
                 if l_actionState != 'fak_air_nose':
2415
                 if l_actionState != 'fak_air_nose':
2387
                     skater.stopAction(flip_layer)
2419
                     skater.stopAction(flip_layer)
2388
                     deck.stopAction(flip_layer)
2420
                     deck.stopAction(flip_layer)
2389
                     trucks.stopAction(flip_layer)                    
2421
                     trucks.stopAction(flip_layer)                    
2390
-                    # skater.playAction("fak_noseg", 40,30, layer=trans_layer, play_mode=0, speed=1)
2391
-                    # deck.playAction("a_fak_noseg", 40,30, layer=trans_layer, play_mode=0, speed=1)
2392
-                    # trucks.playAction("a_fak_noseg", 40,30, layer=trans_layer, play_mode=0, speed=1)        
2393
-                    skater.playAction("fak_nmanual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                
2394
-                    deck.playAction("a_reg_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)
2395
-                    trucks.playAction("a_reg_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                    
2422
+                    skater.playAction("fak_noseg", 40,35, layer=trans_layer, play_mode=0, speed=1)
2423
+                    deck.playAction("a_fak_noseg", 40,35, layer=trans_layer, play_mode=0, speed=1)
2424
+                    trucks.playAction("a_fak_noseg", 40,35, layer=trans_layer, play_mode=0, speed=1)        
2425
+                    #skater.playAction("fak_nmanual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                
2426
+                    #deck.playAction("a_reg_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)
2427
+                    #trucks.playAction("a_reg_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                    
2396
                 else:
2428
                 else:
2397
                     #pass
2429
                     #pass
2398
-                    # skater.playAction("fak_noseg", 30,1, layer=loop_layer, play_mode=1, speed=.5)
2399
-                    # deck.playAction("a_fak_noseg", 30,1, layer=loop_layer, play_mode=1, speed=.5)
2400
-                    # trucks.playAction("a_fak_noseg", 30,1, layer=loop_layer, play_mode=1, speed=.5)
2401
-                    skater.playAction("fak_nmanual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                
2402
-                    deck.playAction("a_reg_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)
2403
-                    trucks.playAction("a_reg_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                    
2430
+                    skater.playAction("fak_noseg", 35,35, layer=loop_layer, play_mode=1, speed=.5)
2431
+                    deck.playAction("a_fak_noseg", 35,35, layer=loop_layer, play_mode=1, speed=.5)
2432
+                    trucks.playAction("a_fak_noseg", 35,35, layer=loop_layer, play_mode=1, speed=.5)
2433
+                    #skater.playAction("fak_nmanual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                
2434
+                    #deck.playAction("a_reg_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)
2435
+                    #trucks.playAction("a_reg_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                    
2404
                     
2436
                     
2405
             if requestAction == 'reg_air_tail':
2437
             if requestAction == 'reg_air_tail':
2406
                 actionState = 'reg_air_tail'
2438
                 actionState = 'reg_air_tail'
2811
         actionState = updateAction(requestAction, actionState)
2843
         actionState = updateAction(requestAction, actionState)
2812
         #own['actionState'] = actionState
2844
         #own['actionState'] = actionState
2813
         
2845
         
2846
+        
2847
+    if (own['actionState'] == 'reg_land' or own['actionState'] == 'reg_land') and own['actionTimer'] > 0:
2848
+        own['clear_request'] = 1    
2814
   
2849
   
2815
 ###################  
2850
 ###################  
2816
     
2851
     
2817
     #debug
2852
     #debug
2818
-    #print("rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'])
2853
+    print("rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'])
2819
     cur_frame = skater.getActionFrame(trans_layer)
2854
     cur_frame = skater.getActionFrame(trans_layer)
2820
     #print(cur_frame)
2855
     #print(cur_frame)
2821
     def printplaying():
2856
     def printplaying():

+ 38
- 4
controller2.py Voir le fichier

828
         if grindHit == True:
828
         if grindHit == True:
829
             linvelloc = own.getLinearVelocity(True)
829
             linvelloc = own.getLinearVelocity(True)
830
             own.applyForce(force, True)
830
             own.applyForce(force, True)
831
-            force2 = [0.0, 0, 150]
831
+            force2 = [0.0, 0, 150]            
832
             own.applyForce(force2, True) 
832
             own.applyForce(force2, True) 
833
             linvelloc2 = own.getLinearVelocity(True)
833
             linvelloc2 = own.getLinearVelocity(True)
834
             force = (linvelloc.x, linvelloc.y, linvelloc2.z)
834
             force = (linvelloc.x, linvelloc.y, linvelloc2.z)
3494
 if stBut == False and own['last_stBut'] == True:
3494
 if stBut == False and own['last_stBut'] == True:
3495
     if own['pause_on'] == True:
3495
     if own['pause_on'] == True:
3496
         own['pause_on'] = False
3496
         own['pause_on'] = False
3497
-        own.restoreDynamics()     
3497
+        #own.restoreDynamics()     
3498
     else:
3498
     else:
3499
         own['pause_on'] = True
3499
         own['pause_on'] = True
3500
-        own.suspendDynamics()            
3500
+        #own.suspendDynamics()            
3501
     
3501
     
3502
 own['last_stBut'] = stBut
3502
 own['last_stBut'] = stBut
3503
      
3503
      
4139
         #print(deltamove)
4139
         #print(deltamove)
4140
         if abs(deltamove) < 1 and delta[1] < 1:
4140
         if abs(deltamove) < 1 and delta[1] < 1:
4141
             own.applyMovement(move, True)               
4141
             own.applyMovement(move, True)               
4142
+
4143
+def air_mover():
4144
+    if r_ground.triggered == False and jump_timer > 53:
4145
+        #print(lUD)
4146
+        if lUD > 0.075:
4147
+            print("air_mover", jump_timer)
4148
+            if STANCE == 0:
4149
+                force2 = [120, 0, 10]
4150
+            if STANCE == 1:
4151
+                force2 = [-120, 0, 10]            
4152
+            
4153
+            own.applyForce(force2, True)
4154
+            #own.applyForce([0,0,5], False)
4155
+    if r_ground.triggered == False and jump_timer > 10 and lUD > 0.075:
4156
+        #print(lUD)
4157
+        print("air_mover", jump_timer)
4158
+        if STANCE == 0:
4159
+            force2 = [7, 0, 10]
4160
+        if STANCE == 1:
4161
+            force2 = [-7, 0, 10]            
4162
+        
4163
+        own.applyForce(force2, True)
4164
+        own.applyForce([0,0,5], False)
4165
+        own['air_mover'] = True
4166
+    else:
4167
+        own['air_mover'] = False        
4142
         
4168
         
4169
+#if grindHit == 1:
4170
+#    skater.applyRotation([0,0,.05], False)
4171
+#    deck.applyRotation([0,0,.05], False)
4172
+#    trucks.applyRotation([0,0,.05], False)
4173
+#else:
4174
+#    skater.applyRotation([0,0,.0], False)            
4175
+#    deck.applyRotation([0,0,.0], False)            
4176
+#    trucks.applyRotation([0,0,.0], False)            
4143
 #control_calib() #scene must be enabled in main                 
4177
 #control_calib() #scene must be enabled in main                 
4144
 jump_Timer()
4178
 jump_Timer()
4145
 check_landing()
4179
 check_landing()
4161
 wallride_sound()
4195
 wallride_sound()
4162
 shutoff_timers()
4196
 shutoff_timers()
4163
 grindout_cleanup()
4197
 grindout_cleanup()
4164
-
4198
+air_mover()
4165
 linvelx = own.getLinearVelocity(True)
4199
 linvelx = own.getLinearVelocity(True)
4166
 
4200
 
4167
 own["linvelx"] = linvelx.x
4201
 own["linvelx"] = linvelx.x

+ 3
- 3
grindV2.py Voir le fichier

543
                
543
                
544
             
544
             
545
     
545
     
546
-    if grindDar.positive == False and grindTouch.positive 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:
546
+    if grindDar.positive == False and grindTouch.positive 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 own['air_mover'] == False:
547
         print("touching, no dar")
547
         print("touching, no dar")
548
     #print(grindold, "grindold")        
548
     #print(grindold, "grindold")        
549
     if grindDar.positive:
549
     if grindDar.positive:
564
             #print('invertOn')
564
             #print('invertOn')
565
 
565
 
566
         grind_dist = .8#.6
566
         grind_dist = .8#.6
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:
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 and own['air_mover'] == False:
568
         #if grindold == 0 and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject:    
568
         #if grindold == 0 and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject:    
569
             print("new grind trigger")           
569
             print("new grind trigger")           
570
             npos = nearestObject.worldPosition
570
             npos = nearestObject.worldPosition
582
 
582
 
583
         #grind
583
         #grind
584
         #print(dist)
584
         #print(dist)
585
-        if dist < grind_dist and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and own['airup'] == 0 and own['grindoutturn'] == 0 and own['grindjumpturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 50 and invert_on == False:
585
+        if dist < grind_dist and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and own['airup'] == 0 and own['grindoutturn'] == 0 and own['grindjumpturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 50 and invert_on == False and own['air_mover'] == False:
586
             #print("grind")    
586
             #print("grind")    
587
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
587
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
588
             if grindold == 0:
588
             if grindold == 0:

+ 2
- 0
pause.py Voir le fichier

101
     #aBut = cont.sensors["aBut"]
101
     #aBut = cont.sensors["aBut"]
102
     pstate = own["pstate"]
102
     pstate = own["pstate"]
103
     scene = bge.logic.getCurrentScene()
103
     scene = bge.logic.getCurrentScene()
104
+    dict = bge.logic.globalDict
104
     resume = scene.objects["resume"]
105
     resume = scene.objects["resume"]
105
     settings = scene.objects["settings"]
106
     settings = scene.objects["settings"]
106
     level = scene.objects["level"]
107
     level = scene.objects["level"]
108
+    dict['level'] = level
107
     levelselect = scene.objects["levelselect"]
109
     levelselect = scene.objects["levelselect"]
108
     restart = scene.objects["restart"]
110
     restart = scene.objects["restart"]
109
     exit = scene.objects["exit"]
111
     exit = scene.objects["exit"]

Loading…
Annuler
Enregistrer