Browse Source

weekend stuff

shuvit 5 years ago
parent
commit
4955900c6d
10 changed files with 1627 additions and 1534 deletions
  1. 5
    0
      Settings.py
  2. 1
    0
      Startup.py
  3. 9
    3
      car.py
  4. 1522
    1501
      co_ActionState.py
  5. 18
    10
      controller2.py
  6. 14
    0
      inputs.py
  7. 30
    3
      menuV3.py
  8. 1
    0
      npause.py
  9. 2
    0
      scene_init.py
  10. 25
    17
      walk.py

+ 5
- 0
Settings.py View File

@@ -89,6 +89,8 @@ def readSettings():
89 89
     dict['cam_min'] = float(data[57])
90 90
     dict['cam_max'] = float(data[58])
91 91
     dict['music_player'] = int(data[60]) 
92
+    dict['fxaa'] = int(data[62]) 
93
+    dict['FXAA_SPAN_MAX'] = float(data[63])         
92 94
     
93 95
     
94 96
     #print('bc = ', dict['bc'])        
@@ -165,6 +167,9 @@ def writeSettings():
165 167
         writing.write(str(dict["cam_max"])+"\n") 
166 168
         writing.write(str("//music player on / off")+"\n")
167 169
         writing.write(str(dict["music_player"])+"\n")
170
+        writing.write(str("//fxaa")+"\n")
171
+        writing.write(str(dict["fxaa"])+"\n") 
172
+        writing.write(str(dict["FXAA_SPAN_MAX"])+"\n")         
168 173
         
169 174
         #writing.write(str(own["framerate"])+"\n")
170 175
         print("writing settings")

+ 1
- 0
Startup.py View File

@@ -134,6 +134,7 @@ def main():
134 134
     dict['joy_con'] = 1
135 135
     dict['last_joy_con'] = 1
136 136
     dict['last_driving'] = False
137
+    dict['driving_reset'] = False
137 138
     
138 139
     dict['spawned_npc_decks'] = []
139 140
     dict['spawned_npc_trucks'] = []    

+ 9
- 3
car.py View File

@@ -759,14 +759,20 @@ def _steer(controller, car):
759 759
 def exit():
760 760
     print('exit car')
761 761
     scene = bge.logic.getCurrentScene()
762
+    dict = bge.logic.globalDict
762 763
     cube = scene.objects['control_cube.002']
764
+    camera = scene.objects["Camera.003"]
763 765
     own['driving'] = False
764 766
     cube['driving'] = False
765
-
767
+    dict['driving_reset'] = True
768
+    cube.removeParent()
766 769
     cube.applyMovement([0,-1,0], True)
767 770
     cube.removeParent()
768
-    cube.suspendDynamics(False)
769
-    #cont.actuators['Camera'].object = obj
771
+    #cube.suspendDynamics(True)
772
+    cube.restoreDynamics()
773
+    #camobj = scene.objects['camobj']
774
+    #own.actuators['Camera'].object = camobj
775
+    scene.suspend()
770 776
     
771 777
     
772 778
     

+ 1522
- 1501
co_ActionState.py
File diff suppressed because it is too large
View File


+ 18
- 10
controller2.py View File

@@ -2798,16 +2798,16 @@ def main():
2798 2798
             elif grindpos == "reg_5050":  
2799 2799
                 if jumpstance != 3:
2800 2800
                     if jumpstance == 0:
2801
-                        if rLR > .02:
2801
+                        if rLR > .03:
2802 2802
                             grindtype("reg_tailgR")
2803
-                        elif rLR < -.02:
2803
+                        elif rLR < -.03:
2804 2804
                             grindtype("reg_tailgL")
2805 2805
                         else:                        
2806 2806
                             grindtype("reg_tailg")
2807 2807
                     if jumpstance == 1:
2808
-                        if rLR > .02:
2808
+                        if rLR > .03:
2809 2809
                             grindtype("fak_tailgR")
2810
-                        elif rLR < -.02:
2810
+                        elif rLR < -.03:
2811 2811
                             grindtype("fak_tailgL")
2812 2812
                         else:                        
2813 2813
                             grindtype("fak_tailg")
@@ -2815,7 +2815,7 @@ def main():
2815 2815
                     if STANCE == 0:
2816 2816
                         if rLR > .03:
2817 2817
                             grindtype("reg_tailgR")
2818
-                        elif rLR < -.02:
2818
+                        elif rLR < -.03:
2819 2819
                             grindtype("reg_tailgL")
2820 2820
                         else:        
2821 2821
                             grindtype("reg_tailg")
@@ -3565,11 +3565,19 @@ def main():
3565 3565
         lgf = own['last_grind_frame']
3566 3566
         frame = own['framenum']
3567 3567
         frames_since_grinding = frame - lgf
3568
-        if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:    
3569
-            linVelocity4 = own.getLinearVelocity(True)
3570
-            newy = linVelocity4.y * .8 #.4    
3571
-            force = [linVelocity4.x, newy, linVelocity4.z]
3572
-            own.setLinearVelocity(force, True)   
3568
+        ylimit = .8
3569
+        if ground_since < 15:
3570
+            ylimit = ylimit + ((ground_since - 15) * -.005)
3571
+            if ylimit > .99999:
3572
+                ylimit = .9999
3573
+               
3574
+        else:    
3575
+            if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:    
3576
+                linVelocity4 = own.getLinearVelocity(True)
3577
+                newy = linVelocity4.y * ylimit   
3578
+                force = [linVelocity4.x, newy, linVelocity4.z]
3579
+                own.setLinearVelocity(force, True) 
3580
+        print(ylimit, 'ylimit')       
3573 3581
 
3574 3582
     def getoffboard():
3575 3583
         lasty = own['lasty']

+ 14
- 0
inputs.py View File

@@ -239,6 +239,20 @@ def main():
239 239
         dict['lTrig'] = lTrig
240 240
         dict['last_joy_con'] = joy_con
241 241
 
242
+    if dict['driving_reset'] == True:
243
+        dict['driving_reset'] = False
244
+        level = dict['level']
245
+
246
+        scenelist = bge.logic.getSceneList()
247
+        if level in scenelist:
248
+            level = scenelist[level]
249
+            level.resume()
250
+            print('resuming', level)
251
+            cube = level.objects['control_cube.002']
252
+            #cube.suspendDynamics(False)
253
+            #print(scenelist)
254
+            cube.restoreDynamics()
255
+            print(cube.isSuspendDynamics)
242 256
 
243 257
 main()
244 258
 

+ 30
- 3
menuV3.py View File

@@ -375,6 +375,26 @@ def endpoint(funct, motion, dict, cont):
375 375
             cont.activate(cam.actuators["bloom_off"])            
376 376
             cam['bloom_on'] = 0
377 377
             dict['bloom_on'] = 0  
378
+            
379
+#------------
380
+    if funct == 'fxaa on':
381
+        if motion == 'inc':
382
+            cont.activate(cam.actuators["fxaa"])
383
+            cam['fxaa'] = 1
384
+            dict['fxaa'] = 1
385
+        else:
386
+            cont.activate(cam.actuators["fxaa_off"])            
387
+            cam['fxaa'] = 0
388
+            dict['fxaa'] = 0
389
+    if funct == 'fxaa span max':
390
+        b = cam['FXAA_SPAN_MAX']
391
+        if motion == 'inc':
392
+            b += 1
393
+        else:
394
+            b -= 1    
395
+        cam['FXAA_SPAN_MAX'] = b        
396
+        dict['FXAA_SPAN_MAX'] = b  
397
+#---------            
378 398
 
379 399
     if funct == 'shadow on':
380 400
         if motion == 'inc':
@@ -674,7 +694,7 @@ def get_c_list(dict):
674 694
     if dict['mlevel'] == 2:
675 695
         if dict['lv1_opt'] == 'graphics':
676 696
         #if opt == 'settings':
677
-            dict['current_list'] = ['brightness / contrast', 'ao', 'hdr', 'dof', 'bloom']
697
+            dict['current_list'] = ['brightness / contrast', 'ao', 'hdr', 'dof', 'bloom', 'fxaa']
678 698
     if dict['mlevel'] == 2:
679 699
         if dict['lv1_opt'] == 'player':
680 700
         #if opt == 'settings':
@@ -702,7 +722,9 @@ def get_c_list(dict):
702 722
         if dict['lv2_opt'] == 'dof':
703 723
             dict['current_list'] = ['dof on']  
704 724
         if dict['lv2_opt'] == 'bloom':
705
-            dict['current_list'] = ['bloom on']  
725
+            dict['current_list'] = ['bloom on'] 
726
+        if dict['lv2_opt'] == 'fxaa':
727
+            dict['current_list'] = ['fxaa on', 'fxaa span max']     
706 728
             
707 729
         if dict['lv2_opt'] == 'character':
708 730
             dict['current_list'] = player_list   
@@ -832,7 +854,7 @@ def init(own, dict):
832 854
     dict['mlevel'] = 0
833 855
     dict['current_opt'] = ''
834 856
     dict['pause_menu_text'] = ''
835
-    dict['menu_end_points'] = ['exit', 'restart', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo', 'brightness / contrast on', 'brightness value', 'contrast value', 'hdr on', 'avgL', 'hdr strength', 'ao on', 'ao radius', 'ao width', 'ao only', 'dof on', 'sun strength', 'sun rot x', 'sun rot y', 'shadow on', 'ambient strength', 'Demo Scene', 'Empty Lot', 'Park A', 'Training', 'Spine', 'Warehouse', 'Shop', '1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen', 'bloom on', 'cam height', 'focal length', 'min dist', 'max dist', 'enter replay', 'recorder on', 'record length', 'enter replay (press back button)', 'recorder on', 'record length (n/a)', 'physics',] + player_list
857
+    dict['menu_end_points'] = ['exit', 'restart', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo', 'brightness / contrast on', 'brightness value', 'contrast value', 'hdr on', 'avgL', 'hdr strength', 'ao on', 'ao radius', 'ao width', 'ao only', 'dof on', 'sun strength', 'sun rot x', 'sun rot y', 'shadow on', 'ambient strength', 'Demo Scene', 'Empty Lot', 'Park A', 'Training', 'Spine', 'Warehouse', 'Shop', '1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen', 'bloom on', 'cam height', 'focal length', 'min dist', 'max dist', 'enter replay', 'recorder on', 'record length', 'enter replay (press back button)', 'recorder on', 'record length (n/a)', 'physics', 'fxaa on', 'fxaa span max',] + player_list
836 858
     
837 859
 def output(dict):
838 860
     try:
@@ -926,6 +948,11 @@ def output(dict):
926 948
             outp = outp + ': ' + str(dict['fullscreen_on'])  
927 949
         if dict['current_opt'] ==  'bloom on':
928 950
             outp = outp + ': ' + str(dict['bloom_on'])  
951
+        if dict['current_opt'] ==  'fxaa on':
952
+            outp = outp + ': ' + str(dict['fxaa'])  
953
+        if dict['current_opt'] ==  'fxaa span max':
954
+            outp = outp + ': ' + str(dict['FXAA_SPAN_MAX'])              
955
+            
929 956
             
930 957
         if dict['current_opt'] ==  'cam height':
931 958
             outp = outp + '(-0.4): ' + str(dict['cam_height']) 

+ 1
- 0
npause.py View File

@@ -142,5 +142,6 @@ def main():
142 142
     #print(pause_state)
143 143
     dict['last_npause'] = pause_state
144 144
     #print(scene.active_camera, cube['camera'])
145
+
145 146
     
146 147
 main()

+ 2
- 0
scene_init.py View File

@@ -167,6 +167,8 @@ def main():
167 167
     #cam['shadow_on'] = dict['shadow_on']
168 168
     cam['dof_on'] = dict['dof_on']
169 169
     cam['bloom_on'] = dict['bloom_on'] 
170
+    cam['fxaa'] = dict['fxaa']
171
+    cam['FXAA_SPAN_MAX'] = dict['FXAA_SPAN_MAX']     
170 172
     own['grindnew_timer'] = 0   
171 173
     own['last_ramp'] = 0
172 174
     own['requestAction'] = ''

+ 25
- 17
walk.py View File

@@ -61,7 +61,7 @@ cube = scene.objects['control_cube.002']
61 61
 skater = scene.objects["Char4"]
62 62
 deck = scene.objects["deck"]
63 63
 trucks = scene.objects["trucks"]
64
-camobj = scene.objects['camobj']
64
+camobj2 = scene.objects['camobj']
65 65
 throw_deck_empty = scene.objects["throw_deck_empty"]
66 66
 wheel1 = scene.objects["rollen.000"]
67 67
 wheel2 = scene.objects["rollen.001"]
@@ -370,7 +370,7 @@ def getonboard(dict):
370 370
     #print(dict['kb_q'])
371 371
     getonboard = own['getonboard']
372 372
     fliplay2 = 50#8560
373
-    if ((yBut == True and dict['last_yBut'] == False) or dict['kb_q'] == 2) and cont.sensors["vehicleNear"].positive == False:
373
+    if ((yBut == True and dict['last_yBut'] == False) or dict['kb_q'] == 2):# and (cont.sensors["vehicleNear"].positive == False and own['throw_deck'] == False):
374 374
         fliplay3 = fliplay2 + 1 
375 375
         if dropinCol.positive == True: 
376 376
             nearestObject = None
@@ -451,7 +451,7 @@ def getonboard(dict):
451 451
         own['throw_deck'] = False 
452 452
         throw_deck_empty = scene.objects["throw_deck_empty"]
453 453
         throw_deck_empty['kill_deck'] = 1 
454
-    if ((yBut == False and lasty == True) or dict['kb_q'] == 3) and cont.sensors["vehicleNear"].positive == False:               
454
+    if ((yBut == False and lasty == True) or dict['kb_q'] == 3):# and cont.sensors["vehicleNear"].positive == False:               
455 455
         own['getonboard'] = 1 
456 456
         own['walk_idling'] = 0      
457 457
 
@@ -1101,22 +1101,30 @@ def get_on_bike(dict, own):
1101 1101
     scene = bge.logic.getCurrentScene()
1102 1102
     #cam = scene.active_camera
1103 1103
     #dict = bge.logic.globalDict 
1104
-    if vehicleNear.positive and 'bike' in vehicleNear.hitObject:          
1105
-        if yBut == True and dict['last_yBut'] == False and own['throw_deck'] == True:
1106
-            vehicleNear.hitObject.endObject()
1107
-            dict['bike'] = True 
1108
-            cont.activate(own.actuators['bike_state']) 
1104
+    try:
1105
+        if vehicleNear.positive and 'bike' in vehicleNear.hitObject:          
1106
+            if yBut == True and dict['last_yBut'] == False and own['throw_deck'] == True:
1107
+                vehicleNear.hitObject.endObject()
1108
+                dict['bike'] = True 
1109
+                cont.activate(own.actuators['bike_state']) 
1109 1110
 
1110
-            object = "player_bike"
1111
-            # instantly add bullet
1112
-            newbike = scene.addObject(object, own, 0)
1113
-            #bike.localScale = 4.6            
1114
-            newbike.setParent(cube, False, False)
1115
-            #rot = [ 0.0, 0.0, 1.570796327]
1116
-            #bike.applyRotation(rot,False) 
1117
-            
1111
+                object = "player_bike"
1112
+                # instantly add bullet
1113
+                newbike = scene.addObject(object, own, 0)
1114
+                #bike.localScale = 4.6            
1115
+                newbike.setParent(cube, False, False)
1116
+                #rot = [ 0.0, 0.0, 1.570796327]
1117
+                #bike.applyRotation(rot,False) 
1118
+    except:
1119
+        pass            
1118 1120
                                               
1119
-                
1121
+if dict['driving_reset'] == True:
1122
+    scene.resume()
1123
+    cube.suspendDynamics(False)
1124
+    cont.actuators['Camera'].object = camobj2
1125
+    cont.activate(own.actuators['walk'])
1126
+    #dict['driving_reset'] = False
1127
+    #print('reseting driving')                
1120 1128
 onboard() 
1121 1129
 jump()
1122 1130
 dropin()

Loading…
Cancel
Save