shuvit 6 years ago
parent
commit
4066f28645
3 changed files with 696 additions and 78 deletions
  1. 569
    20
      co_ActionState.py
  2. 79
    39
      controller2.py
  3. 48
    19
      walk.py

+ 569
- 20
co_ActionState.py
File diff suppressed because it is too large
View File


+ 79
- 39
controller2.py View File

314
             own['fall'] = 1
314
             own['fall'] = 1
315
             print("fall: ", playing_frame, own['jump_timer'])
315
             print("fall: ", playing_frame, own['jump_timer'])
316
             if STANCE == 0:
316
             if STANCE == 0:
317
-                own['requestAction'] = 'reg_fall1'
317
+                #own['requestAction'] = 'reg_fall1'
318
+                own['requestAction'] = 'reg_air-walk_air'
318
             if STANCE == 1:
319
             if STANCE == 1:
319
-                own['requestAction'] = 'fak_fall1'                
320
+                #own['requestAction'] = 'fak_fall1'                
321
+                own['requestAction'] = 'fak_air-walk_air'
320
     check_fall()
322
     check_fall()
321
     def check_landing():
323
     def check_landing():
322
         lf_ground = own["lF_ground"]
324
         lf_ground = own["lF_ground"]
1397
             if own["wallride"] != None: 
1399
             if own["wallride"] != None: 
1398
                 jump()             
1400
                 jump()             
1399
         
1401
         
1402
+    def reg_judo_grab_on():
1403
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1404
+        GRAB_ON = own["GRAB_ON"]
1405
+        dict['trick_string'] = 'Judo Grab'
1406
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1407
+            own['requestAction'] = 'reg_judo'
1408
+            grablay2 = grablay + 1
1409
+            GRAB_PLAYED = True
1410
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1411
+    def fak_judo_grab_on():
1412
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1413
+        GRAB_ON = own["GRAB_ON"]
1414
+        dict['trick_string'] = 'Fak Judo Grab'
1415
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1416
+            own['requestAction'] = 'fak_judo'
1417
+            grablay2 = grablay + 1
1418
+            GRAB_PLAYED = True
1419
+            own["GRAB_PLAYED)"] = GRAB_PLAYED            
1420
+                
1421
+
1400
     def frontside_grab_on():
1422
     def frontside_grab_on():
1401
         GRAB_PLAYED = own["GRAB_PLAYED"]
1423
         GRAB_PLAYED = own["GRAB_PLAYED"]
1402
         GRAB_ON = own["GRAB_ON"]
1424
         GRAB_ON = own["GRAB_ON"]
1460
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1482
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1461
         elif r_ground.triggered == 1:
1483
         elif r_ground.triggered == 1:
1462
             killact(400)
1484
             killact(400)
1463
-        print("frontside nosegrab on")
1485
+        #print("frontside nosegrab on")
1464
     def frontside_tail_grab_on():
1486
     def frontside_tail_grab_on():
1465
         GRAB_PLAYED = own["GRAB_PLAYED"]
1487
         GRAB_PLAYED = own["GRAB_PLAYED"]
1466
         GRAB_ON = own["GRAB_ON"]
1488
         GRAB_ON = own["GRAB_ON"]
1470
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1492
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1471
         elif r_ground.triggered == 1:
1493
         elif r_ground.triggered == 1:
1472
             killact(400)    
1494
             killact(400)    
1473
-        print("frontside tailgrab on")  
1495
+        #print("frontside tailgrab on")  
1474
     def backside_nose_grab_on():
1496
     def backside_nose_grab_on():
1475
         GRAB_PLAYED = own["GRAB_PLAYED"]
1497
         GRAB_PLAYED = own["GRAB_PLAYED"]
1476
         GRAB_ON = own["GRAB_ON"]
1498
         GRAB_ON = own["GRAB_ON"]
1488
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1510
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1489
         elif r_ground.triggered == 1:
1511
         elif r_ground.triggered == 1:
1490
             killact(405)    
1512
             killact(405)    
1491
-        print("backside nosegrab on")
1513
+        #print("backside nosegrab on")
1492
     def backside_tail_grab_on():
1514
     def backside_tail_grab_on():
1493
         GRAB_PLAYED = own["GRAB_PLAYED"]
1515
         GRAB_PLAYED = own["GRAB_PLAYED"]
1494
         GRAB_ON = own["GRAB_ON"]
1516
         GRAB_ON = own["GRAB_ON"]
1498
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1520
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1499
         elif r_ground.triggered == 1:
1521
         elif r_ground.triggered == 1:
1500
             killact(411)    
1522
             killact(411)    
1501
-        print("backside tailgrab on")
1523
+        #print("backside tailgrab on")
1502
     #switch    
1524
     #switch    
1503
     def fak_frontside_nose_grab_on():
1525
     def fak_frontside_nose_grab_on():
1504
         GRAB_PLAYED = own["GRAB_PLAYED"]
1526
         GRAB_PLAYED = own["GRAB_PLAYED"]
1509
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1531
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1510
         elif r_ground.triggered == 1:
1532
         elif r_ground.triggered == 1:
1511
             killact(406)      
1533
             killact(406)      
1512
-        print("fak frontside nosegrab on")
1534
+        #print("fak frontside nosegrab on")
1513
     def fak_frontside_tail_grab_on():
1535
     def fak_frontside_tail_grab_on():
1514
         GRAB_PLAYED = own["GRAB_PLAYED"]
1536
         GRAB_PLAYED = own["GRAB_PLAYED"]
1515
         GRAB_ON = own["GRAB_ON"]
1537
         GRAB_ON = own["GRAB_ON"]
1519
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1541
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1520
         elif r_ground.triggered == 1:
1542
         elif r_ground.triggered == 1:
1521
             killact(412)    
1543
             killact(412)    
1522
-        print("fak frontside tailgrab on")  
1544
+        #print("fak frontside tailgrab on")  
1523
     def fak_backside_nose_grab_on():
1545
     def fak_backside_nose_grab_on():
1524
         GRAB_PLAYED = own["GRAB_PLAYED"]
1546
         GRAB_PLAYED = own["GRAB_PLAYED"]
1525
         GRAB_ON = own["GRAB_ON"]
1547
         GRAB_ON = own["GRAB_ON"]
1529
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1551
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1530
         elif r_ground.triggered == 1:
1552
         elif r_ground.triggered == 1:
1531
             killact(408)         
1553
             killact(408)         
1532
-        print("fak backside nosegrab on")
1554
+        #print("fak backside nosegrab on")
1533
     def fak_backside_tail_grab_on():
1555
     def fak_backside_tail_grab_on():
1534
         GRAB_PLAYED = own["GRAB_PLAYED"]
1556
         GRAB_PLAYED = own["GRAB_PLAYED"]
1535
         GRAB_ON = own["GRAB_ON"]
1557
         GRAB_ON = own["GRAB_ON"]
1539
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1561
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1540
         elif r_ground.triggered == 1:
1562
         elif r_ground.triggered == 1:
1541
             killact(410)    
1563
             killact(410)    
1542
-        print("fak backside tailgrab on")         
1564
+        #print("fak backside tailgrab on")         
1543
     #--------------------
1565
     #--------------------
1544
             
1566
             
1545
     def SWAG():
1567
     def SWAG():
3364
         GRAB_ON = True
3386
         GRAB_ON = True
3365
         own["GRAB_ON"] = GRAB_ON
3387
         own["GRAB_ON"] = GRAB_ON
3366
         #print(rTrig)
3388
         #print(rTrig)
3367
-        if STANCE == False and rUD >= -.07 and rUD <= .07:
3368
-            backside_grab_on()
3369
-        elif STANCE == True and rUD >= -.07 and rUD <= .07:
3370
-            fakfrontside_grab_on()
3371
-        #front_nose    
3372
-        if STANCE == True and rUD < -0.070:
3373
-            fak_frontside_nose_grab_on()
3374
-        #front_tail    
3375
-        elif STANCE == True and rUD > 0.07:
3376
-            fak_frontside_tail_grab_on() 
3377
-        #front_nose    
3378
-        if STANCE == False and rUD < -0.070:
3379
-            backside_nose_grab_on()
3380
-        #front_tail    
3381
-        elif STANCE == False and rUD > 0.07:
3382
-            backside_tail_grab_on()                  
3389
+        if aBut == False and xBut == False:
3390
+            if STANCE == False and rUD >= -.07 and rUD <= .07:
3391
+                backside_grab_on()
3392
+            elif STANCE == True and rUD >= -.07 and rUD <= .07:
3393
+                fakfrontside_grab_on()
3394
+            #front_nose    
3395
+            if STANCE == True and rUD < -0.070:
3396
+                fak_frontside_nose_grab_on()
3397
+            #front_tail    
3398
+            elif STANCE == True and rUD > 0.07:
3399
+                fak_frontside_tail_grab_on() 
3400
+            #front_nose    
3401
+            if STANCE == False and rUD < -0.070:
3402
+                backside_nose_grab_on()
3403
+            #front_tail    
3404
+            elif STANCE == False and rUD > 0.07:
3405
+                backside_tail_grab_on()  
3406
+        else:
3407
+            if STANCE == False:
3408
+                reg_judo_grab_on()
3409
+            elif STANCE == True:
3410
+                fak_judo_grab_on()            
3411
+                                            
3383
             
3412
             
3384
     #kill grabs        
3413
     #kill grabs        
3385
     if lTrig <= 0.02 and GRAB_ON == True and lTrig >= -.02 and rTrig <= .02 and rTrig >= -.2:
3414
     if lTrig <= 0.02 and GRAB_ON == True and lTrig >= -.02 and rTrig <= .02 and rTrig >= -.2:
3455
         if ddPad == 1:   
3484
         if ddPad == 1:   
3456
             spawn_pos = own['spawn_pos']
3485
             spawn_pos = own['spawn_pos']
3457
             spawn_rot = own['spawn_rot']
3486
             spawn_rot = own['spawn_rot']
3487
+            spawn_cam_pos = own['spawn_cam_pos']
3488
+            spawn_cam_rot = own['spawn_cam_rot']            
3458
             try:
3489
             try:
3459
                 own.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
3490
                 own.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
3460
                 own.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
3491
                 own.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
3492
+                cam.worldPosition = (spawn_cam_pos[0], spawn_cam_pos[1], (spawn_cam_pos[2]))
3493
+                cam.worldOrientation = [[spawn_cam_rot[0][0],spawn_cam_rot[0][1],spawn_cam_rot[0][2]], [spawn_cam_rot[1][0],spawn_cam_rot[1][1],spawn_cam_rot[1][2]], [0.0, 0.0, 1.0]]            
3461
             except:    
3494
             except:    
3462
                 own.worldPosition = (0, 0, .1)
3495
                 own.worldPosition = (0, 0, .1)
3463
-                own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]           
3496
+                own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]] 
3497
+                                      
3464
             if own["spawn_stance"] == 1:
3498
             if own["spawn_stance"] == 1:
3465
                 own.setLinearVelocity([.1,0,0], 1)
3499
                 own.setLinearVelocity([.1,0,0], 1)
3466
                 
3500
                 
3468
                 own.setLinearVelocity([-.1,0,0], 1)         
3502
                 own.setLinearVelocity([-.1,0,0], 1)         
3469
                 
3503
                 
3470
         if udPad == 1:
3504
         if udPad == 1:
3505
+            
3471
             own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]] 
3506
             own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]] 
3472
             own['spawn_rot'] = [[own.worldOrientation[0][0],own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0],own.worldOrientation[1][1],own.worldOrientation[1][2]], own.worldOrientation[2][2]]
3507
             own['spawn_rot'] = [[own.worldOrientation[0][0],own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0],own.worldOrientation[1][1],own.worldOrientation[1][2]], own.worldOrientation[2][2]]
3508
+            own['spawn_cam_pos'] = [cam.worldPosition[0], cam.worldPosition[1], cam.worldPosition[2]] 
3509
+            own['spawn_cam_rot'] = [[cam.worldOrientation[0][0],cam.worldOrientation[0][1],cam.worldOrientation[0][2]], [cam.worldOrientation[1][0],cam.worldOrientation[1][1],cam.worldOrientation[1][2]], cam.worldOrientation[2][2]]            
3473
             stance = own["stance"]
3510
             stance = own["stance"]
3474
             own["spawn_stance"] = stance
3511
             own["spawn_stance"] = stance
3475
      
3512
      
3816
             outloc = 0.022
3853
             outloc = 0.022
3817
             bsoutloc = .07
3854
             bsoutloc = .07
3818
             bsoutvel = .1
3855
             bsoutvel = .1
3819
-            outrot = .02 #0.012
3856
+            outrot = .06#2 #0.012
3820
             outrot2 = .24
3857
             outrot2 = .24
3821
             outact = own.actuators["grindoutRight"]
3858
             outact = own.actuators["grindoutRight"]
3822
             STANCE = own['grind_stance'] 
3859
             STANCE = own['grind_stance'] 
3923
                 own['gt_cd'] = 0 
3960
                 own['gt_cd'] = 0 
3924
     #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
3961
     #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
3925
         reg_move = .05
3962
         reg_move = .05
3926
-        reg_rot = 0.02
3963
+        reg_rot = 0.02#2
3927
         reg_rot2 = .26
3964
         reg_rot2 = .26
3928
         reg_move2 = .13
3965
         reg_move2 = .13
3929
         bsforce = 50
3966
         bsforce = 50
3930
         bs_dloc = .03
3967
         bs_dloc = .03
3931
         outvel = own.linearVelocity
3968
         outvel = own.linearVelocity
3969
+        if own["coping"] == 1:
3970
+            reg_rot = reg_rot *3
3971
+            print('coping on')
3932
         if own['gt_cd2'] > 50 and own['jump_timer'] < 20:
3972
         if own['gt_cd2'] > 50 and own['jump_timer'] < 20:
3933
             if own['grind_out_type'] == 'reg right':
3973
             if own['grind_out_type'] == 'reg right':
3934
-                #print("do reg right")
3974
+                print("do reg right")
3935
                 own.applyMovement([0,reg_move,0], True)
3975
                 own.applyMovement([0,reg_move,0], True)
3936
-                own.applyRotation([0,0,reg_rot],True)
3976
+                own.applyRotation([0,0,-reg_rot],True)
3937
             if own['grind_out_type'] == 'fak right':
3977
             if own['grind_out_type'] == 'fak right':
3938
                 own.applyMovement([0,-reg_move,0], True)
3978
                 own.applyMovement([0,-reg_move,0], True)
3939
                 own.applyRotation([0,0,-reg_rot],True)
3979
                 own.applyRotation([0,0,-reg_rot],True)
3940
-                #print("do fak right") 
3980
+                print("do fak right") 
3941
             if own['grind_out_type'] == 'reg left':
3981
             if own['grind_out_type'] == 'reg left':
3942
-                #print("do reg left")
3982
+                print("do reg left")
3943
                 own.applyMovement([0,-reg_move,0], True)
3983
                 own.applyMovement([0,-reg_move,0], True)
3944
                 own.applyRotation([0,0,reg_rot],True)           
3984
                 own.applyRotation([0,0,reg_rot],True)           
3945
             if own['grind_out_type'] == 'fak left':
3985
             if own['grind_out_type'] == 'fak left':
3946
                 own.applyMovement([0,reg_move,0], True)
3986
                 own.applyMovement([0,reg_move,0], True)
3947
-                own.applyRotation([0,0,-reg_rot],True)
3948
-                #print("do fak left") 
3987
+                own.applyRotation([0,0,reg_rot],True)
3988
+                print("do fak left") 
3949
             if own['grind_out_type'] == 'reg fak right':
3989
             if own['grind_out_type'] == 'reg fak right':
3950
                 if own['gt_cd2'] > 55:
3990
                 if own['gt_cd2'] > 55:
3951
                     own.applyMovement([0,reg_move2,0], True)
3991
                     own.applyMovement([0,reg_move2,0], True)
3952
                 own.applyRotation([0,0,reg_rot2],True)            
3992
                 own.applyRotation([0,0,reg_rot2],True)            
3953
-                #print("do reg fak right")
3993
+                print("do reg fak right")
3954
             if own['grind_out_type'] == 'fak fak right':
3994
             if own['grind_out_type'] == 'fak fak right':
3955
                 if own['gt_cd2'] > 55:
3995
                 if own['gt_cd2'] > 55:
3956
                     own.applyMovement([0,-reg_move2,0], True)
3996
                     own.applyMovement([0,-reg_move2,0], True)
3957
                 own.applyRotation([0,0,reg_rot2],True)            
3997
                 own.applyRotation([0,0,reg_rot2],True)            
3958
-                #print("do fak fak right") 
3998
+                print("do fak fak right") 
3959
             if own['grind_out_type'] == 'reg fak left':
3999
             if own['grind_out_type'] == 'reg fak left':
3960
                 if own['gt_cd2'] > 55:
4000
                 if own['gt_cd2'] > 55:
3961
                     own.applyMovement([0,-reg_move2,0], True)
4001
                     own.applyMovement([0,-reg_move2,0], True)
3962
                 own.applyRotation([0,0,-reg_rot2],True)             
4002
                 own.applyRotation([0,0,-reg_rot2],True)             
3963
-                #print("do reg fak left")                        
4003
+                print("do reg fak left")                        
3964
             if own['grind_out_type'] == 'fak fak left':
4004
             if own['grind_out_type'] == 'fak fak left':
3965
                 if own['gt_cd2'] > 55:
4005
                 if own['gt_cd2'] > 55:
3966
                     own.applyMovement([0,reg_move2,0], True)
4006
                     own.applyMovement([0,reg_move2,0], True)
3967
                 own.applyRotation([0,0,-reg_rot2],True)            
4007
                 own.applyRotation([0,0,-reg_rot2],True)            
3968
-                #print("do fak fak left")
4008
+                print("do fak fak left")
3969
             if own['grind_out_type'] == 'reg right' or own['grind_out_type'] == 'reg left' or own['grind_out_type'] == 'fak right' or own['grind_out_type'] == 'fak left':   
4009
             if own['grind_out_type'] == 'reg right' or own['grind_out_type'] == 'reg left' or own['grind_out_type'] == 'fak right' or own['grind_out_type'] == 'fak left':   
3970
                 own.setLinearVelocity([outvel.x * 1.01, outvel.y, outvel.z], True)
4010
                 own.setLinearVelocity([outvel.x * 1.01, outvel.y, outvel.z], True)
3971
             if own['grind_out_type'] == 'reg fak right' or own['grind_out_type'] == 'reg fak left' or own['grind_out_type'] == 'fak fak right' or own['grind_out_type'] == 'fak fak left':
4011
             if own['grind_out_type'] == 'reg fak right' or own['grind_out_type'] == 'reg fak left' or own['grind_out_type'] == 'fak fak right' or own['grind_out_type'] == 'fak fak left':

+ 48
- 19
walk.py View File

621
                     elif STANCE == 1 and own['throw_deck'] == 1:
621
                     elif STANCE == 1 and own['throw_deck'] == 1:
622
                         own['requestAction'] = 'fak_idle6'
622
                         own['requestAction'] = 'fak_idle6'
623
 
623
 
624
+
624
 def reset_pos():
625
 def reset_pos():
625
     #reset
626
     #reset
626
-    if ddPad == 1:
627
-        
627
+    if ddPad == 1:   
628
         spawn_pos = own['spawn_pos']
628
         spawn_pos = own['spawn_pos']
629
         spawn_rot = own['spawn_rot']
629
         spawn_rot = own['spawn_rot']
630
-        #spawnz = spawn_pos[2] + .1
630
+        spawn_cam_pos = own['spawn_cam_pos']
631
+        spawn_cam_rot = own['spawn_cam_rot']            
631
         try:
632
         try:
632
-            own.worldPosition = (spawn_pos[0], spawn_pos[1], spawnz)
633
+            own.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
633
             own.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
634
             own.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
635
+            cam.worldPosition = (spawn_cam_pos[0], spawn_cam_pos[1], (spawn_cam_pos[2]))
636
+            cam.worldOrientation = [[spawn_cam_rot[0][0],spawn_cam_rot[0][1],spawn_cam_rot[0][2]], [spawn_cam_rot[1][0],spawn_cam_rot[1][1],spawn_cam_rot[1][2]], [0.0, 0.0, 1.0]]            
634
         except:    
637
         except:    
635
             own.worldPosition = (0, 0, .1)
638
             own.worldPosition = (0, 0, .1)
636
-            own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]    
639
+            own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]] 
640
+        own['stance'] = own['spawn_stance']                          
637
         if own["spawn_stance"] == 1:
641
         if own["spawn_stance"] == 1:
638
             own.setLinearVelocity([.1,0,0], 1)
642
             own.setLinearVelocity([.1,0,0], 1)
639
-            #cam.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .25))
640
-            #lx = cam.localPosition[1] 
641
-            #lx = lx - 4
642
-            #cam.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
643
-            #cam.localPosition[1] = lx
644
-         
643
+            
644
+            
645
         else: 
645
         else: 
646
             own.setLinearVelocity([-.1,0,0], 1)         
646
             own.setLinearVelocity([-.1,0,0], 1)         
647
-            #cam.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .25))
648
-            #lx = cam.localPosition[1]
649
-            #lx = lx - 4
650
-            #cam.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
651
-            #cam.localPosition[1] = lx
647
+            
652
     if udPad == 1:
648
     if udPad == 1:
649
+        
653
         own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]] 
650
         own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]] 
654
         own['spawn_rot'] = [[own.worldOrientation[0][0],own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0],own.worldOrientation[1][1],own.worldOrientation[1][2]], own.worldOrientation[2][2]]
651
         own['spawn_rot'] = [[own.worldOrientation[0][0],own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0],own.worldOrientation[1][1],own.worldOrientation[1][2]], own.worldOrientation[2][2]]
652
+        own['spawn_cam_pos'] = [cam.worldPosition[0], cam.worldPosition[1], cam.worldPosition[2]] 
653
+        own['spawn_cam_rot'] = [[cam.worldOrientation[0][0],cam.worldOrientation[0][1],cam.worldOrientation[0][2]], [cam.worldOrientation[1][0],cam.worldOrientation[1][1],cam.worldOrientation[1][2]], cam.worldOrientation[2][2]]            
655
         stance = own["stance"]
654
         stance = own["stance"]
656
-        own["spawn_stance"] = stance    
655
+        own["spawn_stance"] = stance   
657
 def falldeck():
656
 def falldeck():
658
     #print("falldeck")
657
     #print("falldeck")
659
     throw_deck_empty = scene.objects["throw_deck_empty"]
658
     throw_deck_empty = scene.objects["throw_deck_empty"]
760
         falldeck()
759
         falldeck()
761
         
760
         
762
         if STANCE == 1:
761
         if STANCE == 1:
763
-            own['requestAction'] = 'fak_fall1'
762
+#            own['requestAction'] = 'fak_fall1'
763
+            own['requestAction'] = 'fak_air-walk_air'            
764
             own.setLinearVelocity([3,2,0], True)
764
             own.setLinearVelocity([3,2,0], True)
765
         else:
765
         else:
766
-            own['requestAction'] = 'reg_fall1'
766
+#            own['requestAction'] = 'reg_fall1'
767
+            own['requestAction'] = 'reg_air-walk_air'
767
             own.setLinearVelocity([-3,-2,0], True)    
768
             own.setLinearVelocity([-3,-2,0], True)    
768
         own['fall'] = False
769
         own['fall'] = False
769
 
770
 
1082
     own["walk_idle_frame"] = 0
1083
     own["walk_idle_frame"] = 0
1083
 
1084
 
1084
 
1085
 
1086
+
1087
+if own['stair_counter'] > 5 and r_ground.triggered == False:
1088
+    own.applyForce([0,0,-200], True) 
1089
+    print("applying ground force")
1090
+
1085
 #if own['requestAction'] == None:
1091
 #if own['requestAction'] == None:
1086
 #    if own['throw_deck'] == False:
1092
 #    if own['throw_deck'] == False:
1087
 #        if STANCE == 1:
1093
 #        if STANCE == 1:
1105
     if STANCE == 1:
1111
     if STANCE == 1:
1106
         own['requestAction'] = 'fak_idle1'        
1112
         own['requestAction'] = 'fak_idle1'        
1107
     
1113
     
1114
+    
1115
+    
1116
+def onground():
1117
+    if r_ground.positive:
1118
+        #print('on ground')
1119
+        own['lF_ground_frame'] = own['framenum']
1120
+        if 'grind' in r_ground.hitObject:
1121
+            own.applyForce([0,100,0], True)
1122
+            print('moving away from rail')
1123
+
1124
+    else:
1125
+        #print('in air')    
1126
+        
1127
+        if  own['framenum'] - own['lF_ground_frame'] > 10:
1128
+            if STANCE == 0:            
1129
+                own['requestAction'] = 'reg_walk_air'
1130
+            else:
1131
+                own['requestAction'] = 'fak_walk_air' 
1132
+                
1133
+
1134
+           
1135
+            
1108
                     
1136
                     
1109
 onboard() 
1137
 onboard() 
1110
 jump()
1138
 jump()
1121
 fall()
1149
 fall()
1122
 idle_anim()
1150
 idle_anim()
1123
 sit()
1151
 sit()
1152
+onground()
1124
 #cont.activate(cam.actuators['Camera'])
1153
 #cont.activate(cam.actuators['Camera'])
1125
 #printplaying() 
1154
 #printplaying() 
1126
 
1155
 

Loading…
Cancel
Save