shuvit 6 years ago
parent
commit
79ee12da20
6 changed files with 65 additions and 45 deletions
  1. 2
    1
      Startup.py
  2. 3
    3
      co_ActionState.py
  3. 39
    22
      controller2.py
  4. 6
    3
      inputs.py
  5. 2
    2
      pause.py
  6. 13
    14
      walk.py

+ 2
- 1
Startup.py View File

@@ -122,7 +122,8 @@ def main():
122 122
     dict['rTrig'] = 0.0 
123 123
     
124 124
     dict['last_ltsBut'] = 0.0
125
-    dict['last_rtsBut'] = 0.0    
125
+    dict['last_rtsBut'] = 0.0   
126
+    dict['last_ldPad'] = 0 
126 127
     
127 128
     #dict['shirt_color'] = [.5,1,1,1]
128 129
     

+ 3
- 3
co_ActionState.py View File

@@ -1696,9 +1696,9 @@ def main():
1696 1696
             if requestAction == 'fak_nollie_hardflip':
1697 1697
                 actionState = 'fak_nollie_hardflip'
1698 1698
                 own['actionTimer'] = 38  
1699
-                skater.playAction("fak_hardflip", flip_start_frame,20, layer=flip_layer, play_mode=0, speed=.5)
1700
-                deck.playAction("a_fak_hardflip", flip_start_frame,20, layer=flip_layer, play_mode=0, speed=.5)
1701
-                trucks.playAction("a_fak_hardflip", flip_start_frame,20, layer=flip_layer, play_mode=0, speed=.5)                                                  
1699
+                skater.playAction("fak_nollie_hardflip", flip_start_frame,20, layer=flip_layer, play_mode=0, speed=.5)
1700
+                deck.playAction("a_reg_hardflip.001", flip_start_frame,20, layer=flip_layer, play_mode=0, speed=.5)
1701
+                trucks.playAction("a_reg_hardflip.001", flip_start_frame,20, layer=flip_layer, play_mode=0, speed=.5)                                                  
1702 1702
                 
1703 1703
                      
1704 1704
             #reg_jump

+ 39
- 22
controller2.py View File

@@ -788,21 +788,21 @@ def main():
788 788
                     reg_nmanual_on()                     
789 789
             if own["Pump"] == False:
790 790
                 
791
-                if lLR < -turnsens and STANCE == 0:            
791
+                if (lLR < -turnsens or dict['kb_la'] == 2) and STANCE == 0:
792 792
                     reg_stance_left_on()
793
-                if lLR > -turnsens or LAST_GRIND != grindHit:
793
+                if lLR > -turnsens or LAST_GRIND != grindHit or dict['kb_la'] == 0:
794 794
                     reg_stance_left_off()    
795
-                if lLR > turnsens and STANCE == 0:
795
+                if (lLR > turnsens or dict['kb_ra'] == 2) and STANCE == 0:
796 796
                     reg_stance_right_on()
797
-                if lLR < turnsens or LAST_GRIND != grindHit:
797
+                if lLR < turnsens or LAST_GRIND != grindHit or dict['kb_ra'] == 0:
798 798
                     reg_stance_right_off()   
799
-                if lLR < -turnsens and STANCE == 1:            
799
+                if (lLR < -turnsens or dict['kb_la'] == 2) and STANCE == 1: 
800 800
                     fak_stance_left_on()
801
-                if lLR > -turnsens or LAST_GRIND != grindHit:
801
+                if lLR > -turnsens or LAST_GRIND != grindHit or dict['kb_la'] == 0:
802 802
                     fak_stance_left_off()    
803
-                if lLR > turnsens and STANCE == 1:
803
+                if (lLR > turnsens or dict['kb_ra'] == 2) and STANCE == 1:
804 804
                     fak_stance_right_on()
805
-                if lLR < turnsens or LAST_GRIND != grindHit:
805
+                if lLR < turnsens or LAST_GRIND != grindHit or dict['kb_ra'] == 0:
806 806
                     fak_stance_right_off()                       
807 807
         #air
808 808
         playing = deck.isPlayingAction(fliplay)
@@ -1945,7 +1945,7 @@ def main():
1945 1945
                 if STANCE == 1:   
1946 1946
                     own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)        
1947 1947
     #medium
1948
-        if lLR > (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
1948
+        if (lLR > (turnsens * 1.3) or dict['kb_ra'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1949 1949
             #turn left
1950 1950
             if rot.z < .4:
1951 1951
                 rotation = [ 0.0, 0.0, (-rotamt * 5)] 
@@ -1961,7 +1961,7 @@ def main():
1961 1961
                     own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
1962 1962
                 if STANCE == 1:   
1963 1963
                     own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)  
1964
-        if lLR < (-turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
1964
+        if (lLR < (-turnsens * 1.3) or dict['kb_la'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1965 1965
             #turn right
1966 1966
             if rot.z < .4:
1967 1967
                 rotation = [ 0.0, 0.0, (rotamt * 5)]
@@ -1979,13 +1979,13 @@ def main():
1979 1979
                     own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)        
1980 1980
              
1981 1981
     #air
1982
-        if r_ground.triggered == False and lLR > turnsens and (grindHit == False or (manual == 1 and grindHit == True)) and own["wallride"] == None:
1982
+        if r_ground.triggered == False and (lLR > turnsens or dict['kb_ra'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)) and own["wallride"] == None:
1983 1983
             rotamt = .07
1984 1984
             if STANCE == 0:
1985 1985
                 own.applyRotation([0,0,-rotamt], 1)
1986 1986
             if STANCE == 1:
1987 1987
                 own.applyRotation([0,0,-rotamt], 1) 
1988
-        if r_ground.triggered == False and lLR < -turnsens and (grindHit == False or (manual == 1 and grindHit == True)) and own["wallride"] == None:
1988
+        if r_ground.triggered == False and (lLR < -turnsens or dict['kb_la'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)) and own["wallride"] == None:
1989 1989
             rotamt = .07
1990 1990
             if STANCE == 0:
1991 1991
                 own.applyRotation([0,0,rotamt], 1)
@@ -2893,15 +2893,16 @@ def main():
2893 2893
         q4oncd = q4oncd - 1
2894 2894
         own["Q4oncd"] = q4oncd
2895 2895
     #q5
2896
-    if rUD > .070:
2896
+    if rUD > .070 or dict['kb_space'] == 2:
2897 2897
         if q4on == 0 and q6on == 0:
2898 2898
             #print("q5on")
2899 2899
             q5on = 1
2900 2900
             q5oncd = countdown
2901 2901
             own["Q5oncd"] = q5oncd
2902 2902
         oposin()  
2903
+        print('oposin')
2903 2904
     ground_since = own["framenum"] - own['lF_air_frame']    
2904
-    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) and ground_since > 10:
2905
+    if ((rTrig > 0.02 or dict['kb_lsh'] == 2) and GRAB_ON == False and r_ground.triggered == 1) or (lTrig > 0.02 and GRAB_ON == False and r_ground.triggered == 1) and ground_since > 10:
2905 2906
         pump()
2906 2907
     else:
2907 2908
         own["lastPump"] = False 
@@ -3060,6 +3061,21 @@ def main():
3060 3061
         q3oncd = q3oncd - 1
3061 3062
         own["Q3oncd"] = q3oncd
3062 3063
 
3064
+
3065
+###keyboard fliptricks
3066
+    if dict['kb_space'] == 3:
3067
+        if dict['kb_a'] == 2:
3068
+            kickflip()
3069
+        elif dict['kb_d'] == 2:
3070
+            heelflip()    
3071
+        elif dict['kb_w'] == 2:
3072
+            fsshuvit()
3073
+        elif dict['kb_s'] == 2:
3074
+            shuvit()            
3075
+        else:
3076
+            aollie()    
3077
+
3078
+
3063 3079
 ##########################################
3064 3080
     #trick calls
3065 3081
 ##########################################
@@ -3449,8 +3465,9 @@ def main():
3449 3465
         own['hippy'] = 1
3450 3466
 
3451 3467
     hippy_jump()    
3452
-    if since_a > cush and aBut == 1 and lasta == 1 and (lTrig < 0.02 and rTrig < 0.02) and own['last_hippy'] == 0:
3453
-        if xBut == 0 and hippy == 0 and lastaBut_ground == True:
3468
+    if ((since_a > cush and aBut == 1 and lasta == 1) or dict['kb_ua'] == 2) and (lTrig < 0.02 and rTrig < 0.02) and own['last_hippy'] == 0:
3469
+        print('push')
3470
+        if xBut == 0 and hippy == 0 and (lastaBut_ground == True or dict['kb_ua'] == 2):
3454 3471
             push()
3455 3472
     if since_x > cush and xBut == 1 and lastx == 1 and (lTrig < 0.02 and rTrig < 0.02) and own['last_hippy'] == 0:
3456 3473
         if aBut == 0 and hippy == 0 and lastxBut_ground == True:
@@ -3482,7 +3499,7 @@ def main():
3482 3499
     ####
3483 3500
 
3484 3501
     #y button
3485
-    if own['lasty'] == 1 and yBut ==0:
3502
+    if (own['lasty'] == 1 and yBut ==0) or dict['kb_q'] == 3:
3486 3503
         offboard()        
3487 3504
 
3488 3505
     if own["GRAB_ON"] == True:
@@ -3680,7 +3697,7 @@ def main():
3680 3697
         getoffboard = own['getoffboard']
3681 3698
         if getoffboard == 1 and own['fall'] == False:    
3682 3699
             own['getoffboard'] = 0 
3683
-        if yBut == False and lasty == True:
3700
+        if (yBut == False and lasty == True) or dict['kb_q'] == 3:
3684 3701
             own['getoffboard'] = 1        
3685 3702
 
3686 3703
     def switchcam():
@@ -4002,7 +4019,7 @@ def main():
4002 4019
             if 'reg' in own['l_actionState']:
4003 4020
                 STANCE = 0          
4004 4021
             if own['grindpos'] == 'reg_5050':
4005
-                if lq3on == 1 or lq2on:
4022
+                if lq3on == 1 or lq2on or dict['kb_ra'] == 2:
4006 4023
                     if own['gt_cd2'] == 0:
4007 4024
                         own['gt_cd2'] = 60
4008 4025
 
@@ -4013,7 +4030,7 @@ def main():
4013 4030
                         if own['grind_out_type'] == None:
4014 4031
                              own['grind_out_type'] = 'reg right'                    
4015 4032
                     own["grindoutturn"] = gotcd    
4016
-                if lq7on == 1 or lq8on:
4033
+                if lq7on == 1 or lq8on or dict['kb_la'] == 2:
4017 4034
                     if own['gt_cd2'] == 0:
4018 4035
                         own['gt_cd2'] = 60                
4019 4036
                     if STANCE == True:
@@ -4048,7 +4065,7 @@ def main():
4048 4065
                 outvel = own.getLinearVelocity(1)
4049 4066
                 outact.dLoc = [0, 0, 0]
4050 4067
                 outact.dRot = [0, 0, 0]
4051
-                if lq5on == 1:
4068
+                if lq5on == 1 or dict['kb_da'] == 2:
4052 4069
                     if own['gt_cd2'] == 0:
4053 4070
                         own['gt_cd2'] = 60                 
4054 4071
                     if STANCE == True:
@@ -4065,7 +4082,7 @@ def main():
4065 4082
                              own['grind_out_type'] = 'bs reg back'
4066 4083
                     own["grindoutturn"] = gotcd 
4067 4084
                     own['invert_on'] = 0  
4068
-                if lq1on == 1:
4085
+                if lq1on == 1 or dict['kb_ua'] == 2:
4069 4086
                     if own['gt_cd2'] == 0:
4070 4087
                         own['gt_cd2'] = 60                 
4071 4088
                     if STANCE == True:

+ 6
- 3
inputs.py View File

@@ -59,7 +59,8 @@ def main():
59 59
     kb_q = events.QKEY
60 60
     kb_e = events.EKEY
61 61
     kb_z = events.ZKEY
62
-    kb_c = events.CKEY      
62
+    kb_c = events.CKEY 
63
+    kb_q = events.QKEY      
63 64
     kb_en = events.ENTERKEY   
64 65
     kb_la = events.LEFTARROWKEY
65 66
     kb_ra = events.RIGHTARROWKEY
@@ -77,7 +78,8 @@ def main():
77 78
     dict['last_kb_q'] = dict['kb_q']
78 79
     dict['last_kb_e'] = dict['kb_e']
79 80
     dict['last_kb_z'] = dict['kb_z']
80
-    dict['last_kb_c'] = dict['kb_c']  
81
+    dict['last_kb_c'] = dict['kb_c'] 
82
+    dict['last_kb_q'] = dict['kb_q']  
81 83
     dict['last_kb_en'] = dict['kb_en']  
82 84
     dict['last_kb_la'] = dict['kb_la']
83 85
     dict['last_kb_ra'] = dict['kb_ra']
@@ -93,7 +95,8 @@ def main():
93 95
     dict['kb_q'] = keyboard[kb_q]
94 96
     dict['kb_e'] = keyboard[kb_e]
95 97
     dict['kb_z'] = keyboard[kb_z]
96
-    dict['kb_c'] = keyboard[kb_c]    
98
+    dict['kb_c'] = keyboard[kb_c] 
99
+    dict['kb_q'] = keyboard[kb_q]    
97 100
     dict['kb_en'] = keyboard[kb_en]
98 101
     dict['kb_la'] = keyboard[kb_la]
99 102
     dict['kb_ra'] = keyboard[kb_ra]

+ 2
- 2
pause.py View File

@@ -61,8 +61,8 @@ def main():
61 61
     dict = bge.logic.globalDict
62 62
 #    resume = scene.objects["resume"]
63 63
 #    settings = scene.objects["settings"]
64
-    level = scene.objects["level"]
65
-    dict['level'] = level
64
+    #level = scene.objects["level"]
65
+#    dict['level'] = level
66 66
 #    levelselect = scene.objects["levelselect"]
67 67
 #    restart = scene.objects["restart"]
68 68
 #    exit = scene.objects["exit"]

+ 13
- 14
walk.py View File

@@ -180,13 +180,13 @@ if own['last_walk_frame'] - own['last_roll_frame'] > 55:
180 180
     wf = 0
181 181
    
182 182
    
183
-if dict['kb_lsh'] == 2 and dict['kb_w'] == 2:   
183
+if dict['kb_lsh'] == 2 and dict['kb_ua'] == 2:   
184 184
     print('wtf')   
185 185
    
186
-if ((lup == 1 and aBut == 0) or (dict['kb_w'] == 2 and dict['kb_lsh'] == 0)) and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] == 0:
186
+if ((lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)) and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] == 0:
187 187
     own['walking'] = "regular"
188 188
     walking = "regular"
189
-elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_w'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] != 2:
189
+elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] != 2:
190 190
     own['walking'] = "fast"
191 191
     walking = "fast"
192 192
 else:
@@ -222,7 +222,7 @@ if walking == None:
222 222
         #print("set 0 vel")    
223 223
     
224 224
 #old walking
225
-if (lup == 1 and aBut == 0) or (dict['kb_w'] == 2 and dict['kb_lsh'] == 0)  and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
225
+if (lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)  and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
226 226
     own.actuators["walkondirt"].volume = .2
227 227
     own.actuators["walkondirt"].pitch = 1
228 228
     cont.activate(own.actuators["walkondirt"])
@@ -241,7 +241,7 @@ if (lup == 1 and aBut == 0) or (dict['kb_w'] == 2 and dict['kb_lsh'] == 0)  and
241 241
         else:
242 242
             own['requestAction'] = 'fak_walk'
243 243
        
244
-elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_w'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
244
+elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
245 245
     own.actuators["walkondirt"].volume = .2
246 246
     own.actuators["walkondirt"].pitch = 1.3
247 247
     cont.activate(own.actuators["walkondirt"])
@@ -267,12 +267,12 @@ else:
267 267
     cont.deactivate(own.actuators["walkondirt"])       
268 268
 
269 269
 #turning
270
-if lRight == 1 or dict['kb_d'] == 2:
270
+if lRight == 1 or dict['kb_ra'] == 2:
271 271
     cont.activate(own.actuators['right'])
272 272
 else:
273 273
     cont.deactivate(own.actuators['right'])    
274 274
     
275
-if lLeft == 1 or dict['kb_a'] == 2:
275
+if lLeft == 1 or dict['kb_la'] == 2:
276 276
     cont.activate(own.actuators['left'])    
277 277
 else:
278 278
     cont.deactivate(own.actuators['left'])        
@@ -280,7 +280,7 @@ else:
280 280
 
281 281
 
282 282
 #in air        
283
-if (lup == 1 or dict['kb_w'] != 0) and r_ground.positive == False:
283
+if (lup == 1 or dict['kb_ua'] != 0) and r_ground.positive == False:
284 284
     
285 285
     if stance == 0:
286 286
         cont.deactivate(own.actuators['forward'])
@@ -388,9 +388,10 @@ def dropin():
388 388
         pass       
389 389
         
390 390
 def getonboard():
391
+    print(dict['kb_q'])
391 392
     getonboard = own['getonboard']
392 393
     fliplay2 = 50#8560
393
-    if yBut == True:
394
+    if yBut == True or dict['kb_q'] == 2:
394 395
         fliplay3 = fliplay2 + 1 
395 396
         if dropinCol.positive == True: 
396 397
             nearestObject = None
@@ -448,7 +449,7 @@ def getonboard():
448 449
         fliplay3 = 6000 
449 450
         onboard_speed = .1                                      
450 451
         own['getonboard'] = 0 
451
-    if (yBut == False and lasty == True) or yBut == True and dropinCol.positive:
452
+    if (yBut == False and lasty == True) or (yBut == True or dict['kb_q'] == 2) and dropinCol.positive:
452 453
         deckact = deck.actuators["Visibility"]
453 454
         trucksact = trucks.actuators["Visibility"]
454 455
         wheel1act = wheel1.actuators["Visibility"]
@@ -470,7 +471,7 @@ def getonboard():
470 471
         own['throw_deck'] = False 
471 472
         throw_deck_empty = scene.objects["throw_deck_empty"]
472 473
         throw_deck_empty['kill_deck'] = 1 
473
-    if (yBut == False and lasty == True):               
474
+    if (yBut == False and lasty == True) or dict['kb_q'] == 3:               
474 475
         own['getonboard'] = 1       
475 476
 
476 477
 def nextframe():
@@ -721,7 +722,6 @@ def throwdeck_trigger():
721 722
 def focus_deck():
722 723
     since_air = own['framenum'] - own['lF_air_frame']
723 724
     if cb_td.positive and since_air < 10:
724
-        print('focus!!!!!')
725 725
         object = 'focus_deckA'
726 726
         object2 = 'focus_deckB'            
727 727
         other = throw_deck_empty
@@ -731,8 +731,7 @@ def focus_deck():
731 731
         scene.addObject(object2, other, 0)
732 732
                 
733 733
     if own['throw_deck'] == True:
734
-        if dict['ldPad'] == False and dict['last_ldPad'] == True:
735
-            #focus  
734
+        if dict['ldPad'] == False and dict['last_ldPad'] == True: 
736 735
             object = 'focus_deckA'
737 736
             object2 = 'focus_deckB'            
738 737
             other = throw_deck_empty

Loading…
Cancel
Save