some tests
@ -1,3 +1,14 @@
|
||||
{
|
||||
"language": "zh_cn"
|
||||
"language": "zh_cn",
|
||||
"textures": {
|
||||
"back_ground_space": "back_ground_space.png",
|
||||
"planet": {
|
||||
"earth_ground": "earth_ground.png"
|
||||
},
|
||||
"flame": {
|
||||
"liquid": "liquid_engine_flame.png",
|
||||
"soild": "soild_engine_flame.png",
|
||||
"ion": "ion_engine_flame.png"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
{
|
||||
"width": "1024",
|
||||
"height": "768",
|
||||
"fullscreen": "False",
|
||||
"fullscreen": "0",
|
||||
"caption": "Simple Rocket 0.1",
|
||||
"visible": "True",
|
||||
"resizable":"1",
|
||||
"visible": "1",
|
||||
"style": "None"
|
||||
}
|
12
docs/configes sample/basic_config.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"language": "language",
|
||||
"textures": {
|
||||
"back_ground_space": "xxx.png",
|
||||
"planet": {
|
||||
"xxx": "xxx.png"
|
||||
},
|
||||
"flame": {
|
||||
"xxx": "xxx.png"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
{
|
||||
"width": "int",
|
||||
"height": "int",
|
||||
"fullscreen": "bool",
|
||||
"fullscreen": "`1/0`",
|
||||
"caption": "xxx",
|
||||
"visible": "bool",
|
||||
"resizable":"1/0",
|
||||
"visible": "1/0",
|
||||
"style": "xxx(in list)"
|
||||
}
|
@ -3,9 +3,8 @@ writen by shenjackyuanjie
|
||||
mail: 3695888@qq.com
|
||||
"""
|
||||
# import folders
|
||||
import libs.textures
|
||||
import libs.loads
|
||||
|
||||
# import in this forder
|
||||
import libs.main
|
||||
import libs.loads
|
||||
import libs.setup
|
||||
|
17
libs/main.py
@ -8,8 +8,17 @@ import libs
|
||||
|
||||
from pyglet.app import run
|
||||
from pyglet.window import Window
|
||||
from pyglet.resource import image
|
||||
|
||||
|
||||
def mbool(thing): # stand for my bool
|
||||
if (thing == "True") or (thing == 1) or (thing == "1"):
|
||||
return True
|
||||
elif (thing == "False") or (thing == 0) or (thing == "0"):
|
||||
return False
|
||||
else:
|
||||
raise ValueError("Need a 'like bool' not anything else")
|
||||
|
||||
class Game:
|
||||
def __init__(self):
|
||||
# value
|
||||
@ -21,13 +30,17 @@ class Game:
|
||||
|
||||
def start_game(self):
|
||||
run()
|
||||
return
|
||||
|
||||
def setup(self):
|
||||
# dic
|
||||
self.window_c = libs.loads.config(".\\configs\\window.json")
|
||||
self.tc = libs.loads.config(".\\configs\\basic_config", "textures")
|
||||
# image
|
||||
self.b_g = image("")
|
||||
# window
|
||||
self.window = Window(width=int(self.window_c['width']),
|
||||
height=int(self.window_c['height']),
|
||||
fullscreen=bool(self.window_c['fullscreen']),
|
||||
fullscreen=mbool(self.window_c['fullscreen']),
|
||||
caption=str(self.window_c['caption']),
|
||||
visible=bool(self.window_c['visible']))
|
||||
visible=mbool(self.window_c['visible']))
|
||||
|
@ -1,7 +0,0 @@
|
||||
"""
|
||||
writen by shenjackyuanjie
|
||||
mail: 3695888@qq.com
|
||||
"""
|
||||
# import folders
|
||||
|
||||
# import in this forder
|
Before Width: | Height: | Size: 1.8 MiB |
Before Width: | Height: | Size: 7.6 MiB After Width: | Height: | Size: 7.6 MiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
BIN
textures/ion_engine_flame.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
textures/liquid_engine_flame.png
Normal file
After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
BIN
textures/soild_engine_flame.png
Normal file
After Width: | Height: | Size: 15 KiB |