|
@@ -1811,11 +1811,6 @@ def main():
|
1811
|
1811
|
wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=2)
|
1812
|
1812
|
wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=2)
|
1813
|
1813
|
wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=2)
|
1814
|
|
-
|
1815
|
|
- def transspeed():
|
1816
|
|
- num1 = .1
|
1817
|
|
- num2 = .4
|
1818
|
|
- speed = 20
|
1819
|
1814
|
|
1820
|
1815
|
def turn():
|
1821
|
1816
|
#rotamt = .02
|
|
@@ -1837,7 +1832,9 @@ def main():
|
1837
|
1832
|
if lUD > turnsens or lUD < -turnsens:
|
1838
|
1833
|
own["turnud"] = 1
|
1839
|
1834
|
else:
|
1840
|
|
- own["turnud"] = 0
|
|
1835
|
+ own["turnud"] = 0
|
|
1836
|
+
|
|
1837
|
+ turnVel = .01
|
1841
|
1838
|
#light
|
1842
|
1839
|
#if manual and grindhit = true
|
1843
|
1840
|
if lLR > turnsens and lLR < (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
|
|
@@ -1876,9 +1873,9 @@ def main():
|
1876
|
1873
|
if r_ground.triggered == True:
|
1877
|
1874
|
#print("med turn")
|
1878
|
1875
|
if STANCE == 0:
|
1879
|
|
- own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
|
|
1876
|
+ own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y - turnVel, linVelocity2.z], 1)
|
1880
|
1877
|
if STANCE == 1:
|
1881
|
|
- own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
|
|
1878
|
+ own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y - turnVel, linVelocity2.z], 1)
|
1882
|
1879
|
if (lLR < (-turnsens * 1.3) or dict['kb_la'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
|
1883
|
1880
|
#turn right
|
1884
|
1881
|
if rot.z < .4:
|
|
@@ -2628,10 +2625,10 @@ def main():
|
2628
|
2625
|
air()
|
2629
|
2626
|
stance()
|
2630
|
2627
|
turn()
|
2631
|
|
- rotmult()
|
|
2628
|
+ #rotmult()
|
2632
|
2629
|
airup()
|
2633
|
2630
|
onramp()
|
2634
|
|
- speedmult()
|
|
2631
|
+ #speedmult()
|
2635
|
2632
|
coping()
|
2636
|
2633
|
resetjumpstance()
|
2637
|
2634
|
grass()
|
|
@@ -3603,7 +3600,7 @@ def main():
|
3603
|
3600
|
if STANCE == 0:
|
3604
|
3601
|
yvel *= -1
|
3605
|
3602
|
try:
|
3606
|
|
- dist = r_ground.hitObject.worldPosition - own.worldPosition
|
|
3603
|
+ #dist = r_ground.hitObject.worldPosition - own.worldPosition
|
3607
|
3604
|
#print('ground dist', dist)
|
3608
|
3605
|
if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
|
3609
|
3606
|
own.applyRotation([0,0,yvel], True)
|
|
@@ -3614,10 +3611,21 @@ def main():
|
3614
|
3611
|
pass
|
3615
|
3612
|
else:
|
3616
|
3613
|
if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:
|
3617
|
|
- linVelocity4 = own.getLinearVelocity(True)
|
3618
|
|
- newy = linVelocity4.y * ylimit
|
3619
|
|
- force = [linVelocity4.x, newy, linVelocity4.z]
|
3620
|
|
- own.setLinearVelocity(force, True)
|
|
3614
|
+ # linVelocity4 = own.getLinearVelocity(True)
|
|
3615
|
+ # newy = linVelocity4.y * ylimit
|
|
3616
|
+ # force = [linVelocity4.x, newy, linVelocity4.z]
|
|
3617
|
+ # own.setLinearVelocity(force, True)
|
|
3618
|
+ yvel = own.linearVelocity.y
|
|
3619
|
+ yvel = yvel *.03
|
|
3620
|
+ if STANCE == 0:
|
|
3621
|
+ yvel *= -1
|
|
3622
|
+ try:
|
|
3623
|
+ if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
|
|
3624
|
+ own.applyRotation([0,0,yvel], True)
|
|
3625
|
+
|
|
3626
|
+ except:
|
|
3627
|
+ pass
|
|
3628
|
+
|
3621
|
3629
|
#print(ylimit, 'ylimit')
|
3622
|
3630
|
|
3623
|
3631
|
def getoffboard():
|
|
@@ -3934,6 +3942,9 @@ def main():
|
3934
|
3942
|
cont.deactivate(own.actuators['grindoutRight'])
|
3935
|
3943
|
cont.deactivate(own.actuators['grindoutLeft'])
|
3936
|
3944
|
if (LAST_GRIND == True and jumping == None and sincegrinding > 20 and ground_since > 20) or own['invert_on'] == True and LAST_GRIND == 1:
|
|
3945
|
+
|
|
3946
|
+ #own['grindTouch']
|
|
3947
|
+
|
3937
|
3948
|
outloc = 0.022
|
3938
|
3949
|
bsoutloc = .07
|
3939
|
3950
|
bsoutvel = .1
|
|
@@ -4304,7 +4315,7 @@ def main():
|
4304
|
4315
|
onboard()
|
4305
|
4316
|
#wallhit()
|
4306
|
4317
|
linvelx = own.getLinearVelocity(True)
|
4307
|
|
- land_boost()
|
|
4318
|
+ #land_boost()
|
4308
|
4319
|
own["linvelx"] = linvelx.x
|
4309
|
4320
|
LAST_STANCE = STANCE
|
4310
|
4321
|
LAST_STANCE = own["stance"]
|
|
@@ -4342,10 +4353,52 @@ def main():
|
4342
|
4353
|
own["last_sel"] = own["sel"]
|
4343
|
4354
|
own["sel"] = bkBut
|
4344
|
4355
|
|
4345
|
|
- if r_ground.triggered and own["jump_timer"] < 20:
|
|
4356
|
+ if r_ground.triggered and own["jump_timer"] < 20 and own['rotz'] > .65:
|
4346
|
4357
|
force2 = [0.0, 0, dict['antibounce']]
|
4347
|
|
- own.applyForce(force2, True)
|
|
4358
|
+ #own.applyForce(force2, True)
|
|
4359
|
+
|
|
4360
|
+ gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))
|
|
4361
|
+ #print(gdist)
|
|
4362
|
+ if gdist < .2875 and gdist > .1:
|
|
4363
|
+ #move = 2.875 - gdist
|
|
4364
|
+ move = (.2875 - gdist)*.33
|
|
4365
|
+ #move = (own.worldPosition.z + gdist)
|
|
4366
|
+ if move > 0:
|
|
4367
|
+ own.worldPosition.z = own.worldPosition.z + move
|
|
4368
|
+ else:
|
|
4369
|
+ own.worldPosition.z = own.worldPosition.z - move
|
|
4370
|
+ own.linearVelocity.z = 0
|
|
4371
|
+
|
|
4372
|
+
|
|
4373
|
+ Axis = 2
|
|
4374
|
+ Distance = -10
|
|
4375
|
+ # X axis is zero
|
|
4376
|
+ # Y is 1
|
|
4377
|
+ # Z is 2
|
|
4378
|
+ End = own.worldPosition + (own.worldOrientation.col[Axis]*Distance)
|
|
4379
|
+ Start = own.worldPosition
|
|
4380
|
+ localRay = own.rayCast(End,Start,0,'ground',1,0,0)
|
|
4381
|
+ #print(localRay)
|
|
4382
|
+ if localRay[0]:
|
|
4383
|
+ localHitDist = (own.worldPosition - localRay[1]).length
|
|
4384
|
+ #print(localHitDist)
|
|
4385
|
+ #print(localRay[2])
|
|
4386
|
+ if localHitDist < .287:
|
|
4387
|
+ own.localPosition[2] += (.287 - localHitDist)
|
|
4388
|
+ if localRay[2] != [0,0,-1] and grindHit == 0:
|
|
4389
|
+ own.alignAxisToVect(localRay[2], 2, .5)
|
|
4390
|
+ #print('moving local')
|
|
4391
|
+
|
|
4392
|
+
|
|
4393
|
+ #rend = bge.render
|
|
4394
|
+ #rend.drawLine(Start, End, [1,0,0,1])
|
|
4395
|
+ #print(own['rotz'])
|
|
4396
|
+
|
|
4397
|
+ if own.linearVelocity.x > 10:
|
|
4398
|
+ own.linearVelocity.x = 10
|
4348
|
4399
|
if (grindDar == False and r_ground.triggered and own['grindTouch'] == False) or own['jump_timer'] > 40:
|
4349
|
4400
|
own['grindType'] = ''
|
4350
|
4401
|
|
4351
|
|
- dict['walk'] = 0
|
|
4402
|
+ dict['walk'] = 0
|
|
4403
|
+
|
|
4404
|
+ print(own["LAST_GRIND"])
|