|
@@ -4350,7 +4350,7 @@ def main():
|
4350
|
4350
|
own["last_sel"] = own["sel"]
|
4351
|
4351
|
own["sel"] = bkBut
|
4352
|
4352
|
|
4353
|
|
- if r_ground.triggered and own["jump_timer"] < 20:
|
|
4353
|
+ if r_ground.triggered and own["jump_timer"] < 20 and own['rotz'] > .65:
|
4354
|
4354
|
force2 = [0.0, 0, dict['antibounce']]
|
4355
|
4355
|
#own.applyForce(force2, True)
|
4356
|
4356
|
|
|
@@ -4358,23 +4358,38 @@ def main():
|
4358
|
4358
|
#print(gdist)
|
4359
|
4359
|
if gdist < .2875 and gdist > .1:
|
4360
|
4360
|
#move = 2.875 - gdist
|
4361
|
|
- move = (.2875 - gdist)*.5
|
|
4361
|
+ move = (.2875 - gdist)*.33
|
4362
|
4362
|
#move = (own.worldPosition.z + gdist)
|
4363
|
4363
|
if move > 0:
|
4364
|
4364
|
own.worldPosition.z = own.worldPosition.z + move
|
4365
|
4365
|
else:
|
4366
|
4366
|
own.worldPosition.z = own.worldPosition.z - move
|
4367
|
4367
|
own.linearVelocity.z = 0
|
4368
|
|
- #f3 = own.force
|
4369
|
|
- #own.force.z = 0
|
4370
|
|
- #print(move, own.worldPosition.z)
|
4371
|
|
- #own.applyForce([0,0,0], True)
|
4372
|
|
- #print(gdist, 'gdist', move)
|
4373
|
|
- #aligner = getAxisVect([r_ground.hitPosition])
|
4374
|
|
- #vectTo = own.getVectTo(r_ground.hitPosition)
|
4375
|
|
- #own.alignAxisToVect(-vectTo[2], 2, .5)
|
4376
|
|
-
|
4377
|
|
- #print(own.worldPosition.z, 'wp')
|
|
4368
|
+
|
|
4369
|
+
|
|
4370
|
+ Axis = 2
|
|
4371
|
+ Distance = -10
|
|
4372
|
+ # X axis is zero
|
|
4373
|
+ # Y is 1
|
|
4374
|
+ # Z is 2
|
|
4375
|
+ End = own.worldPosition + (own.worldOrientation.col[Axis]*Distance)
|
|
4376
|
+ Start = own.worldPosition
|
|
4377
|
+ localRay = own.rayCast(End,Start,0,'ground',1,0,0)
|
|
4378
|
+ #print(localRay)
|
|
4379
|
+ if localRay[0]:
|
|
4380
|
+ localHitDist = (own.worldPosition - localRay[1]).length
|
|
4381
|
+ #print(localHitDist)
|
|
4382
|
+ print(localRay[2])
|
|
4383
|
+ if localHitDist < .287:
|
|
4384
|
+ own.localPosition[2] += (.287 - localHitDist)
|
|
4385
|
+ if localRay[2] != [0,0,-1] and grindHit == 0:
|
|
4386
|
+ own.alignAxisToVect(localRay[2], 2, .5)
|
|
4387
|
+ print('moving local')
|
|
4388
|
+
|
|
4389
|
+
|
|
4390
|
+ #rend = bge.render
|
|
4391
|
+ #rend.drawLine(Start, End, [1,0,0,1])
|
|
4392
|
+ #print(own['rotz'])
|
4378
|
4393
|
|
4379
|
4394
|
if own.linearVelocity.x > 10:
|
4380
|
4395
|
own.linearVelocity.x = 10
|