shuvit 6 years ago
parent
commit
6e430bf206
3 changed files with 19 additions and 6 deletions
  1. 2
    2
      co_ActionState.py
  2. 10
    1
      controller2.py
  3. 7
    3
      grindV2.py

+ 2
- 2
co_ActionState.py View File

312
                 deck.stopAction(trans_layer)
312
                 deck.stopAction(trans_layer)
313
                 print("stopping loop and trans")                                
313
                 print("stopping loop and trans")                                
314
                 actionState = 'reg_land'
314
                 actionState = 'reg_land'
315
-                own['actionTimer'] = 39
315
+                own['actionTimer'] = 37
316
                 skater.playAction("reg_land", 1,20, layer=trans_layer, play_mode=0, speed=.5)
316
                 skater.playAction("reg_land", 1,20, layer=trans_layer, play_mode=0, speed=.5)
317
                 deck.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
317
                 deck.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
318
                 trucks.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)                        
318
                 trucks.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)                        
325
                 skater.stopAction(trans_layer)
325
                 skater.stopAction(trans_layer)
326
                 trucks.stopAction(trans_layer)
326
                 trucks.stopAction(trans_layer)
327
                 deck.stopAction(trans_layer)                                
327
                 deck.stopAction(trans_layer)                                
328
-                own['actionTimer'] = 39
328
+                own['actionTimer'] = 37
329
                 skater.playAction("fak_land", 1,20, layer=trans_layer, play_mode=0, speed=.5)                        
329
                 skater.playAction("fak_land", 1,20, layer=trans_layer, play_mode=0, speed=.5)                        
330
                 deck.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
330
                 deck.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
331
                 trucks.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)        
331
                 trucks.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)        

+ 10
- 1
controller2.py View File

4152
             
4152
             
4153
             own.applyForce(force2, True)
4153
             own.applyForce(force2, True)
4154
             #own.applyForce([0,0,5], False)
4154
             #own.applyForce([0,0,5], False)
4155
+            own['no_grind_pull'] = 1
4155
     if r_ground.triggered == False and jump_timer > 10 and lUD > 0.075 and frames_since_grinding > 50:
4156
     if r_ground.triggered == False and jump_timer > 10 and lUD > 0.075 and frames_since_grinding > 50:
4156
         #print(lUD)
4157
         #print(lUD)
4157
         print("air_mover", jump_timer)
4158
         print("air_mover", jump_timer)
4163
         own.applyForce(force2, True)
4164
         own.applyForce(force2, True)
4164
         own.applyForce([0,0,5], False)
4165
         own.applyForce([0,0,5], False)
4165
         own['air_mover'] = True
4166
         own['air_mover'] = True
4167
+        own['no_grind_pull'] = 1
4166
     else:
4168
     else:
4167
-        own['air_mover'] = False        
4169
+        own['air_mover'] = False 
4168
         
4170
         
4171
+        
4172
+framenum = own['framenum']
4173
+last_ground_frame = own['lF_ground_frame']
4174
+lF_air_frame = own['lF_air_frame']
4175
+frames_since_ground = framenum - lF_air_frame               
4176
+if framenum - lF_air_frame > 30:
4177
+    own['no_grind_pull'] = 0           
4169
 #if grindHit == 1:
4178
 #if grindHit == 1:
4170
 #    skater.applyRotation([0,0,.05], False)
4179
 #    skater.applyRotation([0,0,.05], False)
4171
 #    deck.applyRotation([0,0,.05], False)
4180
 #    deck.applyRotation([0,0,.05], False)

+ 7
- 3
grindV2.py View File

80
     #print("--------frame: ", own['framenum'])
80
     #print("--------frame: ", own['framenum'])
81
     #inertia = player.linearVelocity
81
     #inertia = player.linearVelocity
82
     #print(rotz)
82
     #print(rotz)
83
-
83
+    try:
84
+        no_grind_pull = own['no_grind_pull']
85
+    except:    
86
+        own['no_grind_pull'] = 0
87
+        no_grind_pull = 0
84
     #no grind
88
     #no grind
85
     no_grind = 0
89
     no_grind = 0
86
     if jump_timer > 50:
90
     if jump_timer > 50:
564
             #print('invertOn')
568
             #print('invertOn')
565
 
569
 
566
         grind_dist = .8#.6
570
         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 and own['air_mover'] == False:
571
+        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 and no_grind_pull == 0:
568
         #if grindold == 0 and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject:    
572
         #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")           
573
             print("new grind trigger")           
570
             npos = nearestObject.worldPosition
574
             npos = nearestObject.worldPosition
582
 
586
 
583
         #grind
587
         #grind
584
         #print(dist)
588
         #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 and own['air_mover'] == False:
589
+        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 and no_grind_pull == 0:
586
             #print("grind")    
590
             #print("grind")    
587
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
591
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
588
             if grindold == 0:
592
             if grindold == 0:

Loading…
Cancel
Save