shuvit 6 years ago
parent
commit
979e83bd1f
2 changed files with 22 additions and 9 deletions
  1. 18
    8
      controller2.py
  2. 4
    1
      walk.py

+ 18
- 8
controller2.py View File

2203
                 deck.stopAction(fliplay)
2203
                 deck.stopAction(fliplay)
2204
                 trucks.stopAction(fliplay)
2204
                 trucks.stopAction(fliplay)
2205
                 killall() 
2205
                 killall() 
2206
-                if own['dropinTimer'] > 30:
2207
-                    print("dropinanim2")
2206
+                if own['dropinCol'] == True:
2208
                     own['requestAction'] = 'fak_dropin'
2207
                     own['requestAction'] = 'fak_dropin'
2208
+                    own['dropinTimer'] = 60
2209
                 else: 
2209
                 else: 
2210
                     own['requestAction'] = 'fak_onboard'
2210
                     own['requestAction'] = 'fak_onboard'
2211
-                force = (linVelocity.x +1, linVelocity.y, linVelocity.z)
2212
-                own.setLinearVelocity(force, True)
2213
-                own['dropinTimer'] = 60
2211
+                    force = (linVelocity.x +1, linVelocity.y, linVelocity.z)
2212
+                    if own['dropinTimer'] == 0:
2213
+                        own.setLinearVelocity(force, True)                    
2214
+                #force = (linVelocity.x +1, linVelocity.y, linVelocity.z)
2215
+                #own.setLinearVelocity(force, True)
2216
+                #own['dropinTimer'] = 60
2214
         else:
2217
         else:
2215
             num = own['dropinTimer']
2218
             num = own['dropinTimer']
2216
             if num > 0:
2219
             if num > 0:
3992
     def dropinRotate():
3995
     def dropinRotate():
3993
         if own['dropinTimer'] > 30 and own['dropinTimer'] < 40:
3996
         if own['dropinTimer'] > 30 and own['dropinTimer'] < 40:
3994
             rot = [ 0.01, 0.0, 0]
3997
             rot = [ 0.01, 0.0, 0]
3998
+            vel = [linVelocity.x - .25, linVelocity.y, linVelocity.z - .01]
3999
+            if STANCE == 1:
4000
+                rot = [-0.01, 0.0, 0]
4001
+                vel = [linVelocity.x + .25, linVelocity.y, linVelocity.z - .01]
3995
             local = True
4002
             local = True
3996
             own.applyRotation(rot,local)
4003
             own.applyRotation(rot,local)
3997
-            force = (linVelocity.x - .25, linVelocity.y, linVelocity.z - .01 )
3998
-            own.setLinearVelocity(force, local)            
4004
+            #force = (linVelocity.x - .25, linVelocity.y, linVelocity.z - .01 )
4005
+            own.setLinearVelocity(vel, local)            
3999
         if own['dropinTimer'] == 50:
4006
         if own['dropinTimer'] == 50:
4000
-            force = (linVelocity.x -1, linVelocity.y, linVelocity.z )
4007
+            if STANCE == 1:
4008
+                force = (linVelocity.x +1, linVelocity.y, linVelocity.z )
4009
+            else:
4010
+                force = (linVelocity.x -1, linVelocity.y, linVelocity.z )                    
4001
             own.setLinearVelocity(force, True)               
4011
             own.setLinearVelocity(force, True)               
4002
 
4012
 
4003
     framenum = own['framenum']
4013
     framenum = own['framenum']

+ 4
- 1
walk.py View File

658
                     else:
658
                     else:
659
                         grindside = "left"                    
659
                         grindside = "left"                    
660
                     deltamove = delta[2] * .1#.25
660
                     deltamove = delta[2] * .1#.25
661
-                    move = [-deltamove, 0, 0]
661
+                    if STANCE == 0:
662
+                        move = [-deltamove, 0, 0]
663
+                    else:
664
+                        move = [deltamove, 0, 0]                            
662
                     #print("1deltamove", deltamove)
665
                     #print("1deltamove", deltamove)
663
                     own.applyMovement(move, True)                    
666
                     own.applyMovement(move, True)                    
664
                 except:
667
                 except:

Loading…
Cancel
Save