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 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. import bge
  2. import colors
  3. def main():
  4. import bge
  5. #import GameLogic
  6. cont = bge.logic.getCurrentController()
  7. own = cont.owner
  8. dict = bge.logic.globalDict
  9. #print("nnnnnnpause level", dict['level'])
  10. own['last_stBut'] = False
  11. level = dict['level']
  12. scene = bge.logic.getCurrentScene()
  13. cam = scene.objects['Camera.003']
  14. curscene = bge.logic.getCurrentScene()
  15. # scenes = bge.logic.getSceneList()
  16. # for scene in scenes :
  17. # if scene.name == 'main':
  18. # player = scene.objects['player']
  19. # main = bge.logic.getSceneList["main"]
  20. dict['overlay_fadeout'] = 1
  21. scenes = bge.logic.getSceneList()
  22. own['pre_pause_linvel'] = 0.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 == 'sc':
  59. print('setting color of', curscene)
  60. curscene.world.zenithColor = [.23, .23, .25, 1] #[0.1,.2,.4,.5]#[.58, .86, 1.0, 0] #[.3, 0.3, 0.3, 0]
  61. curscene.world.horizonColor = [.1, .15, .3, 1] #[0.1,0,0,1] #[.58, .86, 1.0, 1]
  62. elif level == 'garage18':
  63. print('setting color of', curscene)
  64. curscene.world.zenithColor = [0, 0.0, 0.0, 0]
  65. curscene.world.horizonColor = [0, 0, 0.0, 0]
  66. elif level == 'pats':
  67. print('setting color of', curscene)
  68. if dict['bc'] == 1:
  69. cont.activate(cam.actuators["bc"])
  70. else:
  71. cont.activate(cam.actuators["bc_off"])
  72. if dict['hdr'] == 1:
  73. cont.activate(cam.actuators["hdr"])
  74. else:
  75. cont.activate(cam.actuators["hdr_off"])
  76. if dict['ao'] == 1:
  77. cont.activate(cam.actuators["ao"])
  78. else:
  79. cont.activate(cam.actuators["ao_off"])
  80. if dict['dof_on'] == 1:
  81. cont.activate(cam.actuators["DOF"])
  82. else:
  83. cont.activate(cam.actuators["DOF_off"])
  84. if dict['bloom_on'] == 1:
  85. cont.activate(cam.actuators["Bloom"])
  86. else:
  87. cont.activate(cam.actuators["bloom_off"])
  88. # print(dict['shadow_on'], 'shadow_on')
  89. # if dict['shadow_on'] == 1:
  90. # bge.render.setGLSLMaterialSetting("shadows", 1)
  91. # else:
  92. # bge.render.setGLSLMaterialSetting("shadows", 0)
  93. scene.world.envLightEnergy = dict['ambient_strength']
  94. cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS']
  95. cam['BC_CONTRAST'] = dict['BC_CONTRAST']
  96. cam['bc'] = dict['bc']
  97. cam['hdr'] = dict['hdr']
  98. cam['avgL'] = dict['avgL']
  99. cam['HDRamount'] = dict['HDRamount']
  100. cam['ao'] = dict['ao']
  101. cam['onlyAO'] = dict['onlyAO']
  102. cam['aowidth'] = dict['aowidth']
  103. cam['aoradius'] = dict['aoradius']
  104. cam['ambient_strength'] = dict['ambient_strength']
  105. cam['sun_strength'] = dict['sun_strength']
  106. cam['sun_pos_x'] = dict['sun_rot_x']
  107. cam['sun_pos_y'] = dict['sun_rot_y']
  108. #cam['shadow_on'] = dict['shadow_on']
  109. cam['dof_on'] = dict['dof_on']
  110. cam['bloom_on'] = dict['bloom_on']
  111. cam['fxaa'] = dict['fxaa']
  112. cam['FXAA_SPAN_MAX'] = dict['FXAA_SPAN_MAX']
  113. own['grindnew_timer'] = 0
  114. own['last_ramp'] = 0
  115. own['requestAction'] = ''
  116. own['l_actionState'] = ''
  117. own['actionState'] = ''
  118. own['transition_timer'] = 0
  119. own['transitioning'] = 0
  120. own['driving'] = False
  121. dict['last_driving'] = False
  122. own['last_roty'] = 0.0
  123. own['walk_targ_speed'] = 2
  124. own['walk_fast_targ_speed'] = 5
  125. own['walk_speed'] = 0
  126. own['walk_inc'] = .05
  127. own['walk_jump_timer'] = 0
  128. own['no_grind_timer'] = 0
  129. own['last_jump_frame'] = 0
  130. colors.update_tuck_tex()
  131. print('scene init ran')
  132. main()