Shuvit game master repo. http://shuvit.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

scene_init.py 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. import bge
  2. def main():
  3. import bge
  4. #import GameLogic
  5. cont = bge.logic.getCurrentController()
  6. own = cont.owner
  7. dict = bge.logic.globalDict
  8. #print("nnnnnnpause level", dict['level'])
  9. own['last_stBut'] = False
  10. level = dict['level']
  11. scene = bge.logic.getCurrentScene()
  12. cam = scene.objects['Camera.003']
  13. curscene = bge.logic.getCurrentScene()
  14. # scenes = bge.logic.getSceneList()
  15. # for scene in scenes :
  16. # if scene.name == 'main':
  17. # player = scene.objects['player']
  18. # main = bge.logic.getSceneList["main"]
  19. dict['overlay_fadeout'] = 1
  20. scenes = bge.logic.getSceneList()
  21. own['pre_pause_linvel'] = 0.0
  22. objList = scene.objects
  23. # get object named MainCharacter
  24. parent = objList["control_cube.002"]
  25. # combine child's shape with parent's
  26. compound = True
  27. obj = scene.objects['Char4']
  28. # child is solid
  29. ghost = False
  30. # set parent
  31. obj.setParent( parent, compound, ghost)
  32. for i in scenes:
  33. if i.name == "main":
  34. main = i
  35. for i in scenes:
  36. if i.name == "fade_out":
  37. print('ending fade_out', scenes)
  38. scene2 = i
  39. scene2.end()
  40. if level == 'newday':
  41. brightness = 2.6
  42. cam['BC_BRIGHTNESS'] = 1.3
  43. cam['BC_CONTRAST'] = 1.5
  44. # elif level == 'lot':
  45. # brightness = 2.6
  46. # cam['BC_BRIGHTNESS'] = 1
  47. # cam['BC_CONTRAST'] = 1
  48. # #main.world.zenithColor = [1.0, .9, .975, 0]
  49. # #main.world.horizonColor = [.42, .555, .823, 0]
  50. # curscene.world.zenithColor = [1.0, .9, .975, 0]
  51. # curscene.world.horizonColor = [.42, .555, .823, 0]
  52. #print("sadfasdfsdfasdfasdfasdfasdfasdf")
  53. elif level == 'spine':
  54. brightness = 2.6
  55. cam['BC_BRIGHTNESS'] = .85
  56. cam['BC_CONTRAST'] = 1.1
  57. elif level == 'sc':
  58. print('setting color of', curscene)
  59. curscene.world.zenithColor = [.23, .23, .25, 1] #[0.1,.2,.4,.5]#[.58, .86, 1.0, 0] #[.3, 0.3, 0.3, 0]
  60. curscene.world.horizonColor = [.1, .15, .3, 1] #[0.1,0,0,1] #[.58, .86, 1.0, 1]
  61. elif level == 'garage18':
  62. print('setting color of', curscene)
  63. curscene.world.zenithColor = [0, 0.0, 0.0, 0]
  64. curscene.world.horizonColor = [0, 0, 0.0, 0]
  65. #main.mistEnable = True
  66. #main.mistIntensity = .9
  67. #main.mistStart = 1
  68. #main.mistDistance = 5
  69. elif level == 'pats':
  70. print('setting color of', curscene)
  71. #main.world.zenithColor = [1.0, .9, .975, 0]
  72. #main.world.horizonColor = [.42, .555, .823, 0]
  73. #cam['BC_BRIGHTNESS'] = 1.35
  74. #cam['BC_CONTRAST'] = 1.3
  75. #cam['avgL'] = .6
  76. #cam['HDRamount'] = .45
  77. #main.mistEnable = True
  78. #main.mistIntensity = .9
  79. #main.mistStart = 1
  80. #main.mistDistance = 5
  81. # elif level == 'j_scene':
  82. # print('setting color of', curscene)
  83. # main.world.zenithColor = [1.0, .9, .975, 0]
  84. # main.world.horizonColor = [.42, .555, .823, 0]
  85. # cam['BC_BRIGHTNESS'] = 1.35
  86. # cam['BC_CONTRAST'] = 1.3
  87. # cam['avgL'] = .6
  88. # cam['HDRamount'] = .45
  89. #main.mistEnable = True
  90. #main.mistIntensity = .9
  91. #main.mistStart = 1
  92. #main.mistDistance = 5
  93. # else:
  94. # cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS']
  95. # cam['BC_CONTRAST'] = dict['BC_CONTRAST']
  96. # cam['bc'] = dict['bc']
  97. #main.world.zenithColor = [1.0, .9, .975, 0]
  98. #main.world.horizonColor = [.42, .555, .823, 0]
  99. #main.mistEnable = False
  100. if dict['bc'] == 1:
  101. cont.activate(cam.actuators["bc"])
  102. else:
  103. cont.activate(cam.actuators["bc_off"])
  104. if dict['hdr'] == 1:
  105. cont.activate(cam.actuators["hdr"])
  106. else:
  107. cont.activate(cam.actuators["hdr_off"])
  108. if dict['ao'] == 1:
  109. cont.activate(cam.actuators["ao"])
  110. else:
  111. cont.activate(cam.actuators["ao_off"])
  112. if dict['dof_on'] == 1:
  113. cont.activate(cam.actuators["DOF"])
  114. else:
  115. cont.activate(cam.actuators["DOF_off"])
  116. if dict['bloom_on'] == 1:
  117. cont.activate(cam.actuators["Bloom"])
  118. else:
  119. cont.activate(cam.actuators["bloom_off"])
  120. # print(dict['shadow_on'], 'shadow_on')
  121. # if dict['shadow_on'] == 1:
  122. # bge.render.setGLSLMaterialSetting("shadows", 1)
  123. # else:
  124. # bge.render.setGLSLMaterialSetting("shadows", 0)
  125. scene.world.envLightEnergy = dict['ambient_strength']
  126. cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS']
  127. cam['BC_CONTRAST'] = dict['BC_CONTRAST']
  128. cam['bc'] = dict['bc']
  129. cam['hdr'] = dict['hdr']
  130. cam['avgL'] = dict['avgL']
  131. cam['HDRamount'] = dict['HDRamount']
  132. cam['ao'] = dict['ao']
  133. cam['onlyAO'] = dict['onlyAO']
  134. cam['aowidth'] = dict['aowidth']
  135. cam['aoradius'] = dict['aoradius']
  136. cam['ambient_strength'] = dict['ambient_strength']
  137. cam['sun_strength'] = dict['sun_strength']
  138. cam['sun_pos_x'] = dict['sun_rot_x']
  139. cam['sun_pos_y'] = dict['sun_rot_y']
  140. #cam['shadow_on'] = dict['shadow_on']
  141. cam['dof_on'] = dict['dof_on']
  142. cam['bloom_on'] = dict['bloom_on']
  143. cam['fxaa'] = dict['fxaa']
  144. cam['FXAA_SPAN_MAX'] = dict['FXAA_SPAN_MAX']
  145. own['grindnew_timer'] = 0
  146. own['last_ramp'] = 0
  147. own['requestAction'] = ''
  148. own['l_actionState'] = ''
  149. own['actionState'] = ''
  150. own['transition_timer'] = 0
  151. own['transitioning'] = 0
  152. own['driving'] = False
  153. dict['last_driving'] = False
  154. own['last_roty'] = 0.0
  155. main()