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.0KB

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