json5!
This commit is contained in:
parent
fe318ffe5e
commit
024d96dec6
7
SR-PY.py
7
SR-PY.py
@ -11,16 +11,13 @@ import os
|
||||
|
||||
|
||||
def main():
|
||||
main_path = "d:\\git\\SR"
|
||||
os.chdir(path=main_path)
|
||||
# Python vision check
|
||||
py_v_info = sys.version_info
|
||||
py_v = str("%d.%d.%d" % (py_v_info[0], py_v_info[1], py_v_info[2]))
|
||||
print("Simple Rocket is running on Python Vision %s" % py_v)
|
||||
if py_v_info[0] == 2:
|
||||
raise Exception("Simple Rocket need python vision 3+")
|
||||
game = libs.main.Game
|
||||
game.setup(game)
|
||||
game.start_game(game)
|
||||
# start games
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -3,14 +3,14 @@ writen by shenjackyuanjie
|
||||
mail: 3695888@qq.com
|
||||
"""
|
||||
|
||||
import json
|
||||
import json5
|
||||
|
||||
|
||||
def config(file_name, stack=None):
|
||||
rd = {} # rd -> return
|
||||
try:
|
||||
with open(file_name, "r") as jf: # jf -> json file
|
||||
rd = json.load(jf)
|
||||
rd = json5.load(jf)
|
||||
except FileNotFoundError:
|
||||
raise FileNotFoundError("no config file")
|
||||
if stack != None:
|
||||
|
@ -4,9 +4,11 @@ mail: 3695888@qq.com
|
||||
"""
|
||||
|
||||
from libs.Game_threads import orbit_demo
|
||||
|
||||
import libs
|
||||
import pyglet
|
||||
import threading
|
||||
import multiprocessing
|
||||
|
||||
|
||||
class Game():
|
||||
@ -17,6 +19,3 @@ class Game():
|
||||
def setup(self):
|
||||
self.game_thread = orbit_demo()
|
||||
|
||||
|
||||
test = Game()
|
||||
test.setup()
|
@ -6,6 +6,7 @@ mail: 3695888@qq.com
|
||||
import libs
|
||||
import pyglet
|
||||
import threading
|
||||
import multiprocessing
|
||||
|
||||
import pyglet.app
|
||||
from pyglet.window import Window
|
||||
@ -34,12 +35,14 @@ class RenderThread(threading.Thread, pyglet.window.Window):
|
||||
|
||||
def setup(self):
|
||||
# dic
|
||||
"""
|
||||
self.window_c = libs.loads.config(
|
||||
".\\sys_value\\window.json") # stand for window config
|
||||
self.planet_c = libs.loads.config(
|
||||
".\\sys_value\\planet.json") # stand for planet config
|
||||
self.textures_c = libs.loads.config(
|
||||
".\\sys_value\\basic_config", "textures") # stand for textures config
|
||||
"""
|
||||
# image
|
||||
self.b_g = image("back_ground_space.png")
|
||||
# window
|
||||
|
@ -1 +1,2 @@
|
||||
pyglet
|
||||
pyglet
|
||||
json5
|
Loading…
Reference in New Issue
Block a user