FINALLY!
This commit is contained in:
parent
78bb461ec8
commit
3814fd34c0
17
SR-PY.py
17
SR-PY.py
@ -6,9 +6,22 @@ mail: 3695888@qq.com
|
|||||||
import pyglet
|
import pyglet
|
||||||
import libs
|
import libs
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
def main():
|
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__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
3
configs/basic_config.json
Normal file
3
configs/basic_config.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"language": "zh_cn"
|
||||||
|
}
|
@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
"size" : {
|
"x": "1024",
|
||||||
"x" : "1024",
|
"y": "768",
|
||||||
"y" : "768",
|
"fullscreen": "False",
|
||||||
"fullscreen" : "False"
|
"caption": "Simple Rocket 0.1",
|
||||||
},
|
"visible": "True",
|
||||||
"caption" : "Simple Rocket 0.1",
|
"style": "None"
|
||||||
"visible" : "True",
|
|
||||||
"style" : "None"
|
|
||||||
}
|
}
|
@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
"size" : {
|
"x": "int",
|
||||||
"x" : "int",
|
"y": "int",
|
||||||
"y" : "int",
|
"fullscreen": "bool",
|
||||||
"fullscreen" : "bool"
|
"caption": "xxx",
|
||||||
},
|
"visible": "bool",
|
||||||
"caption" : "xxx",
|
"style": "xxx(in list)"
|
||||||
"visible" : "bool",
|
|
||||||
"style" : "xxx(in list)"
|
|
||||||
}
|
}
|
@ -4,7 +4,8 @@ mail: 3695888@qq.com
|
|||||||
"""
|
"""
|
||||||
# import folders
|
# import folders
|
||||||
import libs.textures
|
import libs.textures
|
||||||
|
import libs.loads
|
||||||
|
|
||||||
# import in this forder
|
# import in this forder
|
||||||
import libs.startup
|
import libs.main
|
||||||
import libs.setups
|
import libs.setup
|
||||||
|
24
libs/loads.py
Normal file
24
libs/loads.py
Normal 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
31
libs/main.py
Normal 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)
|
||||||
|
|
||||||
|
|
@ -2,7 +2,3 @@
|
|||||||
writen by shenjackyuanjie
|
writen by shenjackyuanjie
|
||||||
mail: 3695888@qq.com
|
mail: 3695888@qq.com
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class main():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
@ -3,3 +3,5 @@ writen by shenjackyuanjie
|
|||||||
mail: 3695888@qq.com
|
mail: 3695888@qq.com
|
||||||
"""
|
"""
|
||||||
# import folders
|
# import folders
|
||||||
|
|
||||||
|
# import in this forder
|
||||||
|
Loading…
Reference in New Issue
Block a user