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
     dict['cam_min'] = float(data[57])
89
     dict['cam_min'] = float(data[57])
90
     dict['cam_max'] = float(data[58])
90
     dict['cam_max'] = float(data[58])
91
     dict['music_player'] = int(data[60]) 
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
     #print('bc = ', dict['bc'])        
96
     #print('bc = ', dict['bc'])        
165
         writing.write(str(dict["cam_max"])+"\n") 
167
         writing.write(str(dict["cam_max"])+"\n") 
166
         writing.write(str("//music player on / off")+"\n")
168
         writing.write(str("//music player on / off")+"\n")
167
         writing.write(str(dict["music_player"])+"\n")
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
         #writing.write(str(own["framerate"])+"\n")
174
         #writing.write(str(own["framerate"])+"\n")
170
         print("writing settings")
175
         print("writing settings")

+ 1
- 0
Startup.py View File

134
     dict['joy_con'] = 1
134
     dict['joy_con'] = 1
135
     dict['last_joy_con'] = 1
135
     dict['last_joy_con'] = 1
136
     dict['last_driving'] = False
136
     dict['last_driving'] = False
137
+    dict['driving_reset'] = False
137
     
138
     
138
     dict['spawned_npc_decks'] = []
139
     dict['spawned_npc_decks'] = []
139
     dict['spawned_npc_trucks'] = []    
140
     dict['spawned_npc_trucks'] = []    

+ 9
- 3
car.py View File

759
 def exit():
759
 def exit():
760
     print('exit car')
760
     print('exit car')
761
     scene = bge.logic.getCurrentScene()
761
     scene = bge.logic.getCurrentScene()
762
+    dict = bge.logic.globalDict
762
     cube = scene.objects['control_cube.002']
763
     cube = scene.objects['control_cube.002']
764
+    camera = scene.objects["Camera.003"]
763
     own['driving'] = False
765
     own['driving'] = False
764
     cube['driving'] = False
766
     cube['driving'] = False
765
-
767
+    dict['driving_reset'] = True
768
+    cube.removeParent()
766
     cube.applyMovement([0,-1,0], True)
769
     cube.applyMovement([0,-1,0], True)
767
     cube.removeParent()
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
             elif grindpos == "reg_5050":  
2798
             elif grindpos == "reg_5050":  
2799
                 if jumpstance != 3:
2799
                 if jumpstance != 3:
2800
                     if jumpstance == 0:
2800
                     if jumpstance == 0:
2801
-                        if rLR > .02:
2801
+                        if rLR > .03:
2802
                             grindtype("reg_tailgR")
2802
                             grindtype("reg_tailgR")
2803
-                        elif rLR < -.02:
2803
+                        elif rLR < -.03:
2804
                             grindtype("reg_tailgL")
2804
                             grindtype("reg_tailgL")
2805
                         else:                        
2805
                         else:                        
2806
                             grindtype("reg_tailg")
2806
                             grindtype("reg_tailg")
2807
                     if jumpstance == 1:
2807
                     if jumpstance == 1:
2808
-                        if rLR > .02:
2808
+                        if rLR > .03:
2809
                             grindtype("fak_tailgR")
2809
                             grindtype("fak_tailgR")
2810
-                        elif rLR < -.02:
2810
+                        elif rLR < -.03:
2811
                             grindtype("fak_tailgL")
2811
                             grindtype("fak_tailgL")
2812
                         else:                        
2812
                         else:                        
2813
                             grindtype("fak_tailg")
2813
                             grindtype("fak_tailg")
2815
                     if STANCE == 0:
2815
                     if STANCE == 0:
2816
                         if rLR > .03:
2816
                         if rLR > .03:
2817
                             grindtype("reg_tailgR")
2817
                             grindtype("reg_tailgR")
2818
-                        elif rLR < -.02:
2818
+                        elif rLR < -.03:
2819
                             grindtype("reg_tailgL")
2819
                             grindtype("reg_tailgL")
2820
                         else:        
2820
                         else:        
2821
                             grindtype("reg_tailg")
2821
                             grindtype("reg_tailg")
3565
         lgf = own['last_grind_frame']
3565
         lgf = own['last_grind_frame']
3566
         frame = own['framenum']
3566
         frame = own['framenum']
3567
         frames_since_grinding = frame - lgf
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
     def getoffboard():
3582
     def getoffboard():
3575
         lasty = own['lasty']
3583
         lasty = own['lasty']

+ 14
- 0
inputs.py View File

239
         dict['lTrig'] = lTrig
239
         dict['lTrig'] = lTrig
240
         dict['last_joy_con'] = joy_con
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
 main()
257
 main()
244
 
258
 

+ 30
- 3
menuV3.py View File

375
             cont.activate(cam.actuators["bloom_off"])            
375
             cont.activate(cam.actuators["bloom_off"])            
376
             cam['bloom_on'] = 0
376
             cam['bloom_on'] = 0
377
             dict['bloom_on'] = 0  
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
     if funct == 'shadow on':
399
     if funct == 'shadow on':
380
         if motion == 'inc':
400
         if motion == 'inc':
674
     if dict['mlevel'] == 2:
694
     if dict['mlevel'] == 2:
675
         if dict['lv1_opt'] == 'graphics':
695
         if dict['lv1_opt'] == 'graphics':
676
         #if opt == 'settings':
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
     if dict['mlevel'] == 2:
698
     if dict['mlevel'] == 2:
679
         if dict['lv1_opt'] == 'player':
699
         if dict['lv1_opt'] == 'player':
680
         #if opt == 'settings':
700
         #if opt == 'settings':
702
         if dict['lv2_opt'] == 'dof':
722
         if dict['lv2_opt'] == 'dof':
703
             dict['current_list'] = ['dof on']  
723
             dict['current_list'] = ['dof on']  
704
         if dict['lv2_opt'] == 'bloom':
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
         if dict['lv2_opt'] == 'character':
729
         if dict['lv2_opt'] == 'character':
708
             dict['current_list'] = player_list   
730
             dict['current_list'] = player_list   
832
     dict['mlevel'] = 0
854
     dict['mlevel'] = 0
833
     dict['current_opt'] = ''
855
     dict['current_opt'] = ''
834
     dict['pause_menu_text'] = ''
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
 def output(dict):
859
 def output(dict):
838
     try:
860
     try:
926
             outp = outp + ': ' + str(dict['fullscreen_on'])  
948
             outp = outp + ': ' + str(dict['fullscreen_on'])  
927
         if dict['current_opt'] ==  'bloom on':
949
         if dict['current_opt'] ==  'bloom on':
928
             outp = outp + ': ' + str(dict['bloom_on'])  
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
         if dict['current_opt'] ==  'cam height':
957
         if dict['current_opt'] ==  'cam height':
931
             outp = outp + '(-0.4): ' + str(dict['cam_height']) 
958
             outp = outp + '(-0.4): ' + str(dict['cam_height']) 

+ 1
- 0
npause.py View File

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

+ 2
- 0
scene_init.py View File

167
     #cam['shadow_on'] = dict['shadow_on']
167
     #cam['shadow_on'] = dict['shadow_on']
168
     cam['dof_on'] = dict['dof_on']
168
     cam['dof_on'] = dict['dof_on']
169
     cam['bloom_on'] = dict['bloom_on'] 
169
     cam['bloom_on'] = dict['bloom_on'] 
170
+    cam['fxaa'] = dict['fxaa']
171
+    cam['FXAA_SPAN_MAX'] = dict['FXAA_SPAN_MAX']     
170
     own['grindnew_timer'] = 0   
172
     own['grindnew_timer'] = 0   
171
     own['last_ramp'] = 0
173
     own['last_ramp'] = 0
172
     own['requestAction'] = ''
174
     own['requestAction'] = ''

+ 25
- 17
walk.py View File

61
 skater = scene.objects["Char4"]
61
 skater = scene.objects["Char4"]
62
 deck = scene.objects["deck"]
62
 deck = scene.objects["deck"]
63
 trucks = scene.objects["trucks"]
63
 trucks = scene.objects["trucks"]
64
-camobj = scene.objects['camobj']
64
+camobj2 = scene.objects['camobj']
65
 throw_deck_empty = scene.objects["throw_deck_empty"]
65
 throw_deck_empty = scene.objects["throw_deck_empty"]
66
 wheel1 = scene.objects["rollen.000"]
66
 wheel1 = scene.objects["rollen.000"]
67
 wheel2 = scene.objects["rollen.001"]
67
 wheel2 = scene.objects["rollen.001"]
370
     #print(dict['kb_q'])
370
     #print(dict['kb_q'])
371
     getonboard = own['getonboard']
371
     getonboard = own['getonboard']
372
     fliplay2 = 50#8560
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
         fliplay3 = fliplay2 + 1 
374
         fliplay3 = fliplay2 + 1 
375
         if dropinCol.positive == True: 
375
         if dropinCol.positive == True: 
376
             nearestObject = None
376
             nearestObject = None
451
         own['throw_deck'] = False 
451
         own['throw_deck'] = False 
452
         throw_deck_empty = scene.objects["throw_deck_empty"]
452
         throw_deck_empty = scene.objects["throw_deck_empty"]
453
         throw_deck_empty['kill_deck'] = 1 
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
         own['getonboard'] = 1 
455
         own['getonboard'] = 1 
456
         own['walk_idling'] = 0      
456
         own['walk_idling'] = 0      
457
 
457
 
1101
     scene = bge.logic.getCurrentScene()
1101
     scene = bge.logic.getCurrentScene()
1102
     #cam = scene.active_camera
1102
     #cam = scene.active_camera
1103
     #dict = bge.logic.globalDict 
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
 onboard() 
1128
 onboard() 
1121
 jump()
1129
 jump()
1122
 dropin()
1130
 dropin()

Loading…
Cancel
Save