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
     dict['man_sens_r'] = .08
146
     dict['man_sens_r'] = .08
147
     dict['walk'] = 1
147
     dict['walk'] = 1
148
     dict['cur_ccH_targetHeight'] = .3
148
     dict['cur_ccH_targetHeight'] = .3
149
+    dict['music_start'] = False  
150
+    dict['npause'] = False
151
+    dict['playback'] = False  
149
 
152
 
150
 main()
153
 main()

+ 4
- 1
load_char.py View File

40
     fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'    
40
     fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'    
41
     
41
     
42
     path = bge.logic.expandPath(fileName)
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
     fileName = mainDir + "assets/" + 'bmx_player' + '.blend'    
48
     fileName = mainDir + "assets/" + 'bmx_player' + '.blend'    
46
     
49
     

+ 2
- 16
npause.py View File

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

+ 7
- 1
scene_init.py View File

113
 #    if dict['shadow_on'] == 1:
113
 #    if dict['shadow_on'] == 1:
114
 #        bge.render.setGLSLMaterialSetting("shadows", 1) 
114
 #        bge.render.setGLSLMaterialSetting("shadows", 1) 
115
 #    else:
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
     scene.world.envLightEnergy = dict['ambient_strength']   
124
     scene.world.envLightEnergy = dict['ambient_strength']   
119
     
125
     

Loading…
Cancel
Save