Browse Source

cleaning up physics

shuvit 5 years ago
parent
commit
594207c710

+ 1
- 1
Recordings/shuvit replay.dat
File diff suppressed because it is too large
View File


+ 2
- 2
config.ini View File

@@ -20,7 +20,7 @@ music_player = 1
20 20
 
21 21
 #level
22 22
 ######
23
-level = sc
23
+level = user1
24 24
 #------------
25 25
 
26 26
 #replay recorder
@@ -90,7 +90,7 @@ wheel4_b = 0.08
90 90
 
91 91
 #brightness / contrast
92 92
 bc = 1
93
-BC_BRIGHTNESS = 1.05
93
+BC_BRIGHTNESS = 1.15
94 94
 BC_CONTRAST = 1.0
95 95
 
96 96
 #HDR

BIN
scripts/__pycache__/controller2.cpython-36.pyc View File


BIN
scripts/__pycache__/inputs.cpython-36.pyc View File


BIN
scripts/__pycache__/load_char.cpython-36.pyc View File


BIN
scripts/__pycache__/menuV3.cpython-36.pyc View File


+ 27
- 12
scripts/controller2.py View File

@@ -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

+ 2
- 2
shuvit.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:ff5b5e06025aeb3b56c49383416fe76749cc34457c74537362de4614673b62fe
3
-size 180304480
2
+oid sha256:de4009805703b3e19a354dd042f0efc51298105b7dda97df72a1b525c76ed44c
3
+size 180305952

Loading…
Cancel
Save