shuvit 6 years ago
parent
commit
c3f56541c5
3 changed files with 50 additions and 21 deletions
  1. 12
    1
      co_ActionState.py
  2. 10
    1
      controller2.py
  3. 28
    19
      walk.py

+ 12
- 1
co_ActionState.py View File

@@ -151,7 +151,18 @@ def main():
151 151
             deck.stopAction(loop_layer)
152 152
             skater.stopAction(trans_layer)
153 153
             trucks.stopAction(trans_layer)
154
-            deck.stopAction(trans_layer)                 
154
+            deck.stopAction(trans_layer)  
155
+            
156
+    if 'wall' in requestAction and actionTimer < 10:
157
+        actionTimer = 0
158
+        own['actionTimer'] = 0
159
+        skater.stopAction(flip_layer)
160
+        trucks.stopAction(flip_layer)
161
+        deck.stopAction(flip_layer)
162
+        skater.stopAction(trans_layer)
163
+        trucks.stopAction(trans_layer)
164
+        deck.stopAction(trans_layer)        
165
+                                   
155 166
             
156 167
     #check last actionState to see if an out action is needed    
157 168
     if requestAction not in jump_overrideList:

+ 10
- 1
controller2.py View File

@@ -4081,6 +4081,14 @@ def main():
4081 4081
     if framenum - lF_air_frame > 30:
4082 4082
         own['no_grind_pull'] = 0
4083 4083
 
4084
+    def wallhit():
4085
+        linvelx = linVelocity.x
4086
+        lastx = own["linvelx"]
4087
+        if frames_since_ground > 20 and (abs(lastx) - abs(linvelx)) > .5:
4088
+            print('::::::wallhit')
4089
+            force = (linVelocity.x * -.7, linVelocity.y, linVelocity.z )                    
4090
+            own.setLinearVelocity(force, True)        
4091
+
4084 4092
     jump_Timer()
4085 4093
     check_landing()
4086 4094
     nextframe()
@@ -4100,7 +4108,8 @@ def main():
4100 4108
     grindout_cleanup()
4101 4109
     air_mover()
4102 4110
     dropinRotate()    
4103
-    onboard()    
4111
+    onboard()   
4112
+    #wallhit() 
4104 4113
     linvelx = own.getLinearVelocity(True)
4105 4114
 
4106 4115
     own["linvelx"] = linvelx.x

+ 28
- 19
walk.py View File

@@ -251,15 +251,15 @@ elif lup == 1 and aBut == 1 and yBut == False and (r_ground.positive or own['sta
251 251
 else:
252 252
     vel = own.getLinearVelocity(True)
253 253
     cont.deactivate(own.actuators["walkondirt"])
254
-    if stance == 0:
255
-        cont.deactivate(skater.actuators['aWalk'])
256
-        cont.deactivate(deck.actuators['a_reg_walk'])
257
-        cont.deactivate(trucks.actuators['a_reg_walk'])        
254
+#    if stance == 0:
255
+#        cont.deactivate(skater.actuators['aWalk'])
256
+#        cont.deactivate(deck.actuators['a_reg_walk'])
257
+#        cont.deactivate(trucks.actuators['a_reg_walk'])        
258 258
 
259
-    if stance == 1:
260
-        cont.deactivate(skater.actuators['aWalk_fak'])
261
-        cont.deactivate(deck.actuators['a_fak_walk'])
262
-        cont.deactivate(trucks.actuators['a_fak_walk'])        
259
+#    if stance == 1:
260
+#        cont.deactivate(skater.actuators['aWalk_fak'])
261
+#        cont.deactivate(deck.actuators['a_fak_walk'])
262
+#        cont.deactivate(trucks.actuators['a_fak_walk'])        
263 263
 
264 264
 #in air        
265 265
 if lup == 1 and r_ground.positive == False:
@@ -267,7 +267,7 @@ if lup == 1 and r_ground.positive == False:
267 267
     if stance == 0:
268 268
         cont.deactivate(own.actuators['forward'])
269 269
         cont.deactivate(own.actuators['forward2'])
270
-        cont.deactivate(skater.actuators['aWalk'])
270
+        #cont.deactivate(skater.actuators['aWalk'])
271 271
         killact(4)
272 272
         killact(5)
273 273
         killact(6)
@@ -277,7 +277,7 @@ if lup == 1 and r_ground.positive == False:
277 277
     if stance == 1:    
278 278
         cont.deactivate(own.actuators['backward'])
279 279
         cont.deactivate(own.actuators['backward2'])
280
-        cont.deactivate(skater.actuators['aWalk_fak'])
280
+        #cont.deactivate(skater.actuators['aWalk_fak'])
281 281
         killact(4)
282 282
         killact(5)
283 283
         killact(6)
@@ -682,7 +682,7 @@ def falldeck():
682 682
     cont.activate(wheel3.actuators['Visibility'])
683 683
     cont.activate(wheel4.actuators['Visibility']) 
684 684
 
685
-def throwdeck():
685
+def throwdeck(strength, ud):
686 686
     throw_deck_empty = scene.objects["throw_deck_empty"]
687 687
     deckact = deck.actuators["Visibility"]
688 688
     trucksact = trucks.actuators["Visibility"]
@@ -700,12 +700,19 @@ def throwdeck():
700 700
         wheel3act.visibility = False
701 701
         wheel4act.visibility = False
702 702
         act = throw_deck_empty.actuators['throw_dec_act']
703
+        hard = strength * .08
704
+
705
+        if hard > 9:
706
+            hard = 9
707
+        ud = ud * 4
708
+
709
+        own['bbut_timer'] = 0
703 710
         if STANCE == True:
704 711
             own['requestAction'] = 'fak_throw'
705
-            act.linearVelocity = [0.0, 5.0, 5.0]
712
+            act.linearVelocity = [0.0, ud, hard]
706 713
         if STANCE == False:
707 714
             own['requestAction'] = 'fak_throw'
708
-            act.linearVelocity = [0.0, 5.0, -5.0]  
715
+            act.linearVelocity = [0.0, ud, -hard]  
709 716
         cont.activate(act)
710 717
     else:
711 718
         own['throw_deck'] = False    
@@ -715,23 +722,25 @@ def throwdeck():
715 722
         wheel2act.visibility = True
716 723
         wheel3act.visibility = True
717 724
         wheel4act.visibility = True
718
-        throw_deck_empty['kill_deck'] = 1 
719
-        #print("trying to kill deck")     
725
+        throw_deck_empty['kill_deck'] = 1     
720 726
     cont.activate(deck.actuators['Visibility'])
721 727
     cont.activate(trucks.actuators['Visibility'])
722 728
     cont.activate(wheel1.actuators['Visibility'])
723 729
     cont.activate(wheel2.actuators['Visibility'])
724 730
     cont.activate(wheel3.actuators['Visibility'])
725
-    cont.activate(wheel4.actuators['Visibility'])    
726
-        
731
+    cont.activate(wheel4.actuators['Visibility'])            
727 732
 def throwdeck_trigger():
728 733
     lastb = own['lastb']
729 734
     throw_deck_empty = scene.objects["throw_deck_empty"]
735
+    if bBut == True:
736
+        own['bbut_timer'] += 1
737
+        ud = (rUD * 10) +1
730 738
     if bBut == False:
731 739
         throw_deck_empty['kill_deck'] = 0
732 740
     if bBut == False and own['lastb'] == True:        
733
-        #print("throw deck")
734
-        throwdeck()        
741
+        strength = own['bbut_timer']
742
+        ud = (rUD * 10) +1
743
+        throwdeck(strength, ud)        
735 744
               
736 745
 def fall():
737 746
     if own['fall'] == True:

Loading…
Cancel
Save