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

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