Browse Source

finalizing config

shuvit 5 years ago
parent
commit
fc7f615f0e
4 changed files with 16 additions and 18 deletions
  1. 3
    0
      Startup.py
  2. 4
    1
      load_char.py
  3. 2
    16
      npause.py
  4. 7
    1
      scene_init.py

+ 3
- 0
Startup.py View File

@@ -146,5 +146,8 @@ def main():
146 146
     dict['man_sens_r'] = .08
147 147
     dict['walk'] = 1
148 148
     dict['cur_ccH_targetHeight'] = .3
149
+    dict['music_start'] = False  
150
+    dict['npause'] = False
151
+    dict['playback'] = False  
149 152
 
150 153
 main()

+ 4
- 1
load_char.py View File

@@ -40,7 +40,10 @@ def main(cont):
40 40
     fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'    
41 41
     
42 42
     path = bge.logic.expandPath(fileName)
43
-    bge.logic.LibLoad(path, 'Scene')  
43
+    try:
44
+        bge.logic.LibLoad(path, 'Scene')  
45
+    except:
46
+        pass    
44 47
     
45 48
     fileName = mainDir + "assets/" + 'bmx_player' + '.blend'    
46 49
     

+ 2
- 16
npause.py View File

@@ -11,7 +11,6 @@ def main():
11 11
 
12 12
     cont = bge.logic.getCurrentController()
13 13
     scene = bge.logic.getCurrentScene()
14
-    #own = cont.owner
15 14
     dict = bge.logic.globalDict 
16 15
     
17 16
     skater = scene.objects["Char4"]
@@ -23,7 +22,6 @@ def main():
23 22
     freecam = camList["freecam"] 
24 23
     mcam = camList['Camera.003']   
25 24
     
26
-    #freecam = scene.objects['freecam']
27 25
     cube = scene.objects['control_cube.002']
28 26
     
29 27
     try:
@@ -75,13 +73,10 @@ def main():
75 73
         cont.activate(cont.actuators['empty'])
76 74
         if mcam['playback'] == False:
77 75
             cont.activate(cont.actuators['add_overlay']) 
78
-            #pass
79
-        #printplaying()
80 76
         cont.activate(cont.actuators['remove_stance'])  
81 77
         cube['camera'] = 2
82 78
         cube['camnum'] = 2 
83 79
         scene.active_camera = freecam 
84
-        #print('set freecam', scene.active_camera)
85 80
         freecam.lens = mcam['focal_length'] 
86 81
         freecam.worldPosition = mcam.worldPosition
87 82
         freecam.worldOrientation = mcam.worldOrientation                      
@@ -110,22 +105,16 @@ def main():
110 105
             if trucks.isPlayingAction(layer):    
111 106
                 trucks.stopAction(layer)
112 107
         menuV3.main(cont)                                                    
113
-        
114
-        
115
-        
108
+                
116 109
     #exit pause     
117 110
     if pause_state == 0 and last_pause == 1:
118
-        #print("unpause")
119 111
         Settings.writeSettings()
120 112
         own.restoreDynamics()
121
-        #own['camera'] = 0
122
-        #own.setlinearVelocity([0,0,0],1] 
123
-        
113
+
124 114
         if own['walk'] == False:
125 115
             cont.activate(cont.actuators['roll'])
126 116
         else:
127 117
             cont.activate(cont.actuators['walk'])    
128
-        #print("pre_pause_linvel = ", own['pre_pause_linvel'])
129 118
         try:
130 119
             own.setLinearVelocity(own['pre_pause_linvel'], 1) 
131 120
         except:
@@ -139,9 +128,6 @@ def main():
139 128
             cont.activate(cont.actuators['remove_overlay']) 
140 129
         else:
141 130
             cont.activate(cont.actuators['add_overlay'])                                   
142
-    #print(pause_state)
143 131
     dict['last_npause'] = pause_state
144
-    #print(scene.active_camera, cube['camera'])
145
-
146 132
     
147 133
 main()

+ 7
- 1
scene_init.py View File

@@ -113,7 +113,13 @@ def main():
113 113
 #    if dict['shadow_on'] == 1:
114 114
 #        bge.render.setGLSLMaterialSetting("shadows", 1) 
115 115
 #    else:
116
-#        bge.render.setGLSLMaterialSetting("shadows", 0)         
116
+#        bge.render.setGLSLMaterialSetting("shadows", 0)  
117
+
118
+    if dict['music_player'] == 1:
119
+        dict['music_start'] =  True   
120
+        print('starting music') 
121
+    else:
122
+        print('not starting music', dict['music_player'])        
117 123
         
118 124
     scene.world.envLightEnergy = dict['ambient_strength']   
119 125
     

Loading…
Cancel
Save