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.

Startup.py 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. import bge
  2. import GameLogic
  3. from bge import logic, render
  4. def main():
  5. cont = GameLogic.getCurrentController()
  6. #cont = bge.logic.getCurrentController()
  7. own = cont.owner
  8. #bge.logic.addScene('Main')
  9. scenes = bge.logic.getSceneList()
  10. #print(scenes)
  11. #-------
  12. mainDir = GameLogic.expandPath("//")
  13. fileName = mainDir + "Settings.dat"
  14. with open(fileName) as reading:
  15. #data = [line.split()[0] for line in reading]
  16. data = reading.readlines()
  17. #print lines[25]
  18. #print lines[29]
  19. reading.close()
  20. resx = int(data[7])
  21. resy = int(data[8])
  22. #trick_string = dict.get('trick_string')
  23. #
  24. # fullscreen = bge.render.getFullScreen()
  25. # print("fullscreen = ", fullscreen)
  26. # #if fullscreen != True:
  27. # #bge.render.setFullScreen(True)
  28. # width = render.getWindowWidth()
  29. # if width != resx:
  30. # bge.render.setWindowSize(resx, resy)
  31. #---------
  32. #bge.render.showFramerate
  33. #bge.render.showProfile
  34. #dict = bge.logic.globalDict #Get the global dictionary
  35. #print(dict)
  36. #resx = dict['resx']
  37. #resy = dict['resy']
  38. #main_scene = [scene for scene in scenes if scene.name=="main"][0]
  39. #
  40. # for scene in scenes :
  41. # if scene.name == 'Hud':
  42. # player = scene.objects['player']
  43. # print(scene.name)
  44. #mains = main_scene.objects['Empty']
  45. #resx = mains["resx"]
  46. #resy = mains["resy"]
  47. #print("read res: ", resx, resy)
  48. # if not 'render_settings' in own:
  49. # print("disable mips")
  50. # render.setMipmapping(2)
  51. # actu = cont.actuators['myActuator']
  52. # cont.deactivate(actu)
  53. for i in scenes:
  54. if i.name == "main":
  55. main = i
  56. main.world.zenithColor = [0, 0, 0, 0]
  57. main.world.horizonColor = [0, 0, 0, 0]
  58. scene = bge.logic.getCurrentScene()
  59. black = scene.objects['black']
  60. shuvit_logo = scene.objects['shuvit_logo']
  61. black.playAction('black_fade', 0,100, layer=1, play_mode=0)
  62. shuvit_logo.playAction('logo_fade', 0,100, layer=4, play_mode=0)
  63. print('black on')
  64. dict = bge.logic.globalDict
  65. dict['overlay_fadein'] = 0
  66. dict['overlay_fadeout'] = 0
  67. dict['load_timer'] = 0
  68. dict['reload_timer'] = 0
  69. dict['menu_idle_timer'] = 0
  70. if not any(logic.joysticks):
  71. print("joystick not connnected")
  72. dict['joy_con'] = 0
  73. else:
  74. dict['joy_con'] = 1
  75. dict['kb_a'] = 0
  76. dict['kb_d'] = 0
  77. dict['kb_w'] = 0
  78. dict['kb_s'] = 0
  79. dict['kb_q'] = 0
  80. dict['kb_e'] = 0
  81. dict['kb_z'] = 0
  82. dict['kb_c'] = 0
  83. dict['kb_en'] = 0
  84. dict['kb_la'] = 0
  85. dict['kb_ra'] = 0
  86. dict['kb_ua'] = 0
  87. dict['kb_da'] = 0
  88. dict['kb_lsh'] = 0
  89. dict['kb_space'] = 0
  90. dict['aBut'] = 0.0
  91. dict['bBut'] = 0.0
  92. dict['xBut'] = 0.0
  93. dict['yBut'] = 0.0
  94. dict['lBump'] = 0.0
  95. dict['rBump'] = 0.0
  96. dict['bkBut'] = 0.0
  97. dict['stBut'] = 0.0
  98. dict['xbBut'] = 0.0
  99. dict['ltsBut'] = 0.0
  100. dict['rtsBut'] = 0.0
  101. dict['ldPad'] = 0.0
  102. dict['rdPad'] = 0.0
  103. dict['udPad'] = 0.0
  104. dict['ddPad'] = 0.0
  105. dict['rUD'] = 0.0
  106. dict['lUD'] = 0.0
  107. dict['rLR'] = 0.0
  108. dict['lLR'] = 0.0
  109. dict['rmUD'] = 0.0
  110. dict['lmUD'] = 0.0
  111. dict['rmLR'] = 0.0
  112. dict['lmLR'] = 0.0
  113. dict['mTrig'] = 0.0
  114. dict['lTrig'] = 0.0
  115. dict['rTrig'] = 0.0
  116. dict['last_ltsBut'] = 0.0
  117. dict['last_rtsBut'] = 0.0
  118. dict['last_ldPad'] = 0
  119. #dict['shirt_color'] = [.5,1,1,1]
  120. dict['mu_last_track'] = ''
  121. dict['mu_artist'] = ''
  122. dict['mu_title'] = ''
  123. dict['joy_con'] = 1
  124. dict['last_joy_con'] = 1
  125. dict['last_driving'] = False
  126. dict['driving_reset'] = False
  127. dict['spawned_npc_decks'] = []
  128. dict['spawned_npc_trucks'] = []
  129. dict['spawned_npcs'] = []
  130. #dict['JUMPHEIGHT'] = 800
  131. #dict['MAX_VEL'] = 6.7
  132. dict['char_loaded'] = 0
  133. dict['man_sens_l'] = .03
  134. dict['man_sens_r'] = .08
  135. dict['walk'] = 1
  136. dict['cur_ccH_targetHeight'] = .3
  137. main()