FINALLY!

This commit is contained in:
沈瑗杰 2020-12-05 21:24:54 +08:00
parent 78bb461ec8
commit 3814fd34c0
10 changed files with 90 additions and 24 deletions

View File

@ -6,9 +6,22 @@ mail: 3695888@qq.com
import pyglet
import libs
import json
import sys
import os
def main():
pass
main_path = "d:\\git\\SR"
os.chdir(path=main_path)
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)
if __name__ == "__main__":
main()
main()

View File

@ -0,0 +1,3 @@
{
"language": "zh_cn"
}

View File

@ -1,10 +1,8 @@
{
"size" : {
"x" : "1024",
"y" : "768",
"fullscreen" : "False"
},
"caption" : "Simple Rocket 0.1",
"visible" : "True",
"style" : "None"
"x": "1024",
"y": "768",
"fullscreen": "False",
"caption": "Simple Rocket 0.1",
"visible": "True",
"style": "None"
}

View File

@ -1,10 +1,8 @@
{
"size" : {
"x" : "int",
"y" : "int",
"fullscreen" : "bool"
},
"caption" : "xxx",
"visible" : "bool",
"style" : "xxx(in list)"
"x": "int",
"y": "int",
"fullscreen": "bool",
"caption": "xxx",
"visible": "bool",
"style": "xxx(in list)"
}

View File

@ -4,7 +4,8 @@ mail: 3695888@qq.com
"""
# import folders
import libs.textures
import libs.loads
# import in this forder
import libs.startup
import libs.setups
import libs.main
import libs.setup

24
libs/loads.py Normal file
View File

@ -0,0 +1,24 @@
"""
writen by shenjackyuanjie
mail: 3695888@qq.com
"""
import json
def config(file_name, stack=None):
rd = {} # rd -> return
try:
with open(file_name, "r") as jf: # jf -> json file
rd = json.load(jf)
except FileNotFoundError:
raise
if stack != None:
rd = rd[stack]
return rd
def window_config():
j_config = config("./configs/window.json")
config_r = (j_config)
return config_r

31
libs/main.py Normal file
View File

@ -0,0 +1,31 @@
"""
writen by shenjackyuanjie
mail: 3695888@qq.com
"""
import pyglet
import libs
from pyglet.window import Window
from pyglet.app import run
class Game:
def __init__(self):
# value
# dic
self.parts = {} # now ship parts
self.o_parts = {} # stand for opther parts
self.b_g_e = {} # stand for back ground element
self.window_c = libs.loads.window_config()
# list
def start_game(self):
run()
def setup(self):
# window
self.window = Window(width=800, height=600,
caption='minecraft PE', resizable=True)

View File

@ -2,7 +2,3 @@
writen by shenjackyuanjie
mail: 3695888@qq.com
"""
class main():
def __init__(self):
pass

View File

View File

@ -3,3 +3,5 @@ writen by shenjackyuanjie
mail: 3695888@qq.com
"""
# import folders
# import in this forder