shuvit 6 роки тому
джерело
коміт
d400966d01
2 змінених файлів з 77 додано та 31 видалено
  1. 60
    19
      co_ActionState.py
  2. 17
    12
      controller2.py

+ 60
- 19
co_ActionState.py
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 17
- 12
controller2.py Переглянути файл

969
 
969
 
970
 def jump_Timer():
970
 def jump_Timer():
971
     jump_timer = own['jump_timer']
971
     jump_timer = own['jump_timer']
972
-    if jump_timer == 1:
973
-        pass
974
     if jump_timer > 0:
972
     if jump_timer > 0:
975
         jump_timer = jump_timer - 1
973
         jump_timer = jump_timer - 1
976
         own['jump_timer'] = jump_timer 
974
         own['jump_timer'] = jump_timer 
1017
         pass      
1015
         pass      
1018
 def stop():
1016
 def stop():
1019
     if linVelocity.x < .05 and linVelocity.x > -.05:
1017
     if linVelocity.x < .05 and linVelocity.x > -.05:
1020
-        can_stop = 1
1018
+        can_stop = 0
1021
         own["lastStop"] = True
1019
         own["lastStop"] = True
1022
     else:
1020
     else:
1023
-        can_stop = 0    
1021
+        can_stop = 1    
1024
     if r_ground.triggered == 1 and STANCE == False and can_stop == 1:
1022
     if r_ground.triggered == 1 and STANCE == False and can_stop == 1:
1025
         own['requestAction'] = 'reg_stop'        
1023
         own['requestAction'] = 'reg_stop'        
1026
         yvel = linVelocity.x * .985
1024
         yvel = linVelocity.x * .985
2093
     STANCE = own["stance"]
2091
     STANCE = own["stance"]
2094
     jumpstance = own["jump_stance"]
2092
     jumpstance = own["jump_stance"]
2095
     lif = frame - own['last_invert_frame']
2093
     lif = frame - own['last_invert_frame']
2094
+    if own['LAST_GRIND'] == False and grindHit == True:
2095
+        own['grindstartFrame'] = own['framenum']
2096
+    print(own['grindstartFrame'])    
2096
     if grindHit == True and own['invert_on'] == 0 and own['footplant_on'] == False and own['manual'] == 0 and lif > 40 and own['dropinTimer'] < 30:  
2097
     if grindHit == True and own['invert_on'] == 0 and own['footplant_on'] == False and own['manual'] == 0 and lif > 40 and own['dropinTimer'] < 30:  
2097
         gblend = 1    
2098
         gblend = 1    
2098
         if LAST_GRIND == 0:
2099
         if LAST_GRIND == 0:
2869
         q5on = 1
2870
         q5on = 1
2870
         q5oncd = countdown
2871
         q5oncd = countdown
2871
         own["Q5oncd"] = q5oncd
2872
         own["Q5oncd"] = q5oncd
2872
-    oposin()   
2873
+    oposin()  
2874
+    
2875
+if (rTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1) or (lTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1):
2876
+    pump()
2877
+else:
2878
+    own["lastPump"] = False 
2879
+    own["Pump"] = False     
2880
+     
2873
 if rUD > .02:    
2881
 if rUD > .02:    
2874
     grindpos = own['grindpos']   
2882
     grindpos = own['grindpos']   
2875
     jumpstance = own["jump_stance"]
2883
     jumpstance = own["jump_stance"]
3424
     own["GRAB_PLAYED"] = GRAB_PLAYED
3432
     own["GRAB_PLAYED"] = GRAB_PLAYED
3425
 
3433
 
3426
 #frontside pump #backside pump
3434
 #frontside pump #backside pump
3427
-if (rTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1) or (lTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1):
3428
-    pump()
3429
-else:
3430
-    own["lastPump"] = False 
3431
-    own["Pump"] = False 
3435
+
3432
 def footplant():    
3436
 def footplant():    
3433
     framenum = own['framenum']
3437
     framenum = own['framenum']
3434
     last_ground_frame = own['lF_ground_frame']
3438
     last_ground_frame = own['lF_ground_frame']
3914
     jumping = None
3918
     jumping = None
3915
     gotcd = 25
3919
     gotcd = 25
3916
     force = [0,0,0]
3920
     force = [0,0,0]
3917
-    grindHit = own['grindTouch']       
3921
+    grindHit = own['grindTouch']      
3922
+    sincegrinding = own['framenum']  - own['grindstartFrame']
3918
     if rUD > turnsens or rLR > turnsens or rUD < -turnsens or rLR < -turnsens:
3923
     if rUD > turnsens or rLR > turnsens or rUD < -turnsens or rLR < -turnsens:
3919
        jumping = True
3924
        jumping = True
3920
     if grindHit == False:
3925
     if grindHit == False:
3921
         cont.deactivate(own.actuators['grindoutRight'])
3926
         cont.deactivate(own.actuators['grindoutRight'])
3922
         cont.deactivate(own.actuators['grindoutLeft'])   
3927
         cont.deactivate(own.actuators['grindoutLeft'])   
3923
-    if grindHit == True and jumping == None:
3928
+    if grindHit == True and jumping == None and sincegrinding > 20:
3924
         outloc = 0.022
3929
         outloc = 0.022
3925
         bsoutloc = .07
3930
         bsoutloc = .07
3926
         bsoutvel = .1
3931
         bsoutvel = .1

Завантаження…
Відмінити
Зберегти