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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 == 'garage18':
  58. print('setting color of', curscene)
  59. curscene.world.zenithColor = [0, 0.0, 0.0, 0]
  60. curscene.world.horizonColor = [0, 0, 0.0, 0]
  61. #main.mistEnable = True
  62. #main.mistIntensity = .9
  63. #main.mistStart = 1
  64. #main.mistDistance = 5
  65. elif level == 'pats':
  66. print('setting color of', curscene)
  67. #main.world.zenithColor = [1.0, .9, .975, 0]
  68. #main.world.horizonColor = [.42, .555, .823, 0]
  69. #cam['BC_BRIGHTNESS'] = 1.35
  70. #cam['BC_CONTRAST'] = 1.3
  71. #cam['avgL'] = .6
  72. #cam['HDRamount'] = .45
  73. #main.mistEnable = True
  74. #main.mistIntensity = .9
  75. #main.mistStart = 1
  76. #main.mistDistance = 5
  77. # elif level == 'j_scene':
  78. # print('setting color of', curscene)
  79. # main.world.zenithColor = [1.0, .9, .975, 0]
  80. # main.world.horizonColor = [.42, .555, .823, 0]
  81. # cam['BC_BRIGHTNESS'] = 1.35
  82. # cam['BC_CONTRAST'] = 1.3
  83. # cam['avgL'] = .6
  84. # cam['HDRamount'] = .45
  85. #main.mistEnable = True
  86. #main.mistIntensity = .9
  87. #main.mistStart = 1
  88. #main.mistDistance = 5
  89. # else:
  90. # cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS']
  91. # cam['BC_CONTRAST'] = dict['BC_CONTRAST']
  92. # cam['bc'] = dict['bc']
  93. #main.world.zenithColor = [1.0, .9, .975, 0]
  94. #main.world.horizonColor = [.42, .555, .823, 0]
  95. #main.mistEnable = False
  96. if dict['bc'] == 1:
  97. cont.activate(cam.actuators["bc"])
  98. else:
  99. cont.activate(cam.actuators["bc_off"])
  100. if dict['hdr'] == 1:
  101. cont.activate(cam.actuators["hdr"])
  102. else:
  103. cont.activate(cam.actuators["hdr_off"])
  104. if dict['ao'] == 1:
  105. cont.activate(cam.actuators["ao"])
  106. else:
  107. cont.activate(cam.actuators["ao_off"])
  108. if dict['dof_on'] == 1:
  109. cont.activate(cam.actuators["DOF"])
  110. else:
  111. cont.activate(cam.actuators["DOF_off"])
  112. if dict['bloom_on'] == 1:
  113. cont.activate(cam.actuators["Bloom"])
  114. else:
  115. cont.activate(cam.actuators["bloom_off"])
  116. # print(dict['shadow_on'], 'shadow_on')
  117. # if dict['shadow_on'] == 1:
  118. # bge.render.setGLSLMaterialSetting("shadows", 1)
  119. # else:
  120. # bge.render.setGLSLMaterialSetting("shadows", 0)
  121. scene.world.envLightEnergy = dict['ambient_strength']
  122. cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS']
  123. cam['BC_CONTRAST'] = dict['BC_CONTRAST']
  124. cam['bc'] = dict['bc']
  125. cam['hdr'] = dict['hdr']
  126. cam['avgL'] = dict['avgL']
  127. cam['HDRamount'] = dict['HDRamount']
  128. cam['ao'] = dict['ao']
  129. cam['onlyAO'] = dict['onlyAO']
  130. cam['aowidth'] = dict['aowidth']
  131. cam['aoradius'] = dict['aoradius']
  132. cam['ambient_strength'] = dict['ambient_strength']
  133. cam['sun_strength'] = dict['sun_strength']
  134. cam['sun_pos_x'] = dict['sun_rot_x']
  135. cam['sun_pos_y'] = dict['sun_rot_y']
  136. #cam['shadow_on'] = dict['shadow_on']
  137. cam['dof_on'] = dict['dof_on']
  138. cam['bloom_on'] = dict['bloom_on']
  139. own['grindnew_timer'] = 0
  140. own['last_ramp'] = 0
  141. own['requestAction'] = ''
  142. own['l_actionState'] = ''
  143. own['actionState'] = ''
  144. own['transition_timer'] = 0
  145. own['transitioning'] = 0
  146. own['driving'] = False
  147. dict['last_driving'] = False
  148. own['last_roty'] = 0.0
  149. main()