diff --git a/.gitignore b/.gitignore index 490233a..8290ac4 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,6 @@ eggs/ .eggs/ lib/ lib64/ -parts/ sdist/ var/ wheels/ diff --git a/bin/client.py b/bin/client.py index 812e8e5..7553f13 100644 --- a/bin/client.py +++ b/bin/client.py @@ -53,10 +53,11 @@ class RenderThread(mp.Process, pyglet.window.Window): self.window_config = tools.config('sys_value/window.json5') # dic self.ships = {} # all ship(part) - self.planet_system = {} # hole planet system + self.planet_system = tools.configs('sys_vlaue/planet.json5') # hole planet system # list # re stuff - self.ipv4_re = re.compile(u'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$') + self.ipv4_re = re.compile( + u'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$') # window self.window = Window(width=int(self.window_config['width']), height=int(self.window_config['height']), @@ -93,7 +94,7 @@ class RenderThread(mp.Process, pyglet.window.Window): """ def on_draw(self): - pass + self.part_draw() def part_draw(self): # render parts diff --git a/bin/main.py b/bin/main.py index 3118cd6..154eee0 100644 --- a/bin/main.py +++ b/bin/main.py @@ -11,13 +11,13 @@ import time import logging try: - import tools - import client - import server -except ModuleNotFoundError: from bin import tools from bin import client from bin import server +except ModuleNotFoundError: + import tools + import client + import server class Game: diff --git a/sys_value/parts.json5 b/sys_value/parts.json5 index 63cd77b..199c896 100644 --- a/sys_value/parts.json5 +++ b/sys_value/parts.json5 @@ -1,5 +1,5 @@ { - /* + /* 'part id': [ [ 'part name', @@ -22,6 +22,7 @@ [ 'xxx.png', // texture file name + //可以为包含文件夹的 比如:./engine/xxx.png [ 'float', 'float' @@ -36,32 +37,15 @@ ], // 碰撞箱大小 (暂时只支持方形碰撞箱) //坐标轴也是从左上开始 - //可以为包含文件夹的 比如:./engine/xxx.png [ '特殊值(懒得写)' ] ], */ - 'test1': [ - [ - 'test1', - '一个测试用部件' - ], - [ - 1.0, - false, - 0.1 - ], - [ - 'parts/Beam.png', - [ - 0.0, - 0.0 - ] - ], - [ - 3.0, - 2.0 - ] + test1: [ + ['test1', '一个测试用部件'], + [1.0, false, 0.1], + ['parts/Beam.png', [0.0, 0.0]], + [3.0, 2.0] ] -} \ No newline at end of file +} diff --git a/textures/parts/Battery.png b/textures/parts/Battery.png new file mode 100644 index 0000000..ff25cf6 Binary files /dev/null and b/textures/parts/Battery.png differ diff --git a/textures/parts/Beam.png b/textures/parts/Beam.png new file mode 100644 index 0000000..eb6bd9a Binary files /dev/null and b/textures/parts/Beam.png differ diff --git a/textures/parts/CoverBottom.png b/textures/parts/CoverBottom.png new file mode 100644 index 0000000..e5e7292 Binary files /dev/null and b/textures/parts/CoverBottom.png differ diff --git a/textures/parts/CoverStretch.png b/textures/parts/CoverStretch.png new file mode 100644 index 0000000..27ae10b Binary files /dev/null and b/textures/parts/CoverStretch.png differ diff --git a/textures/parts/CoverTop.png b/textures/parts/CoverTop.png new file mode 100644 index 0000000..82b22a8 Binary files /dev/null and b/textures/parts/CoverTop.png differ diff --git a/textures/parts/DetacherRadial.png b/textures/parts/DetacherRadial.png new file mode 100644 index 0000000..f1f51f1 Binary files /dev/null and b/textures/parts/DetacherRadial.png differ diff --git a/textures/parts/DetacherVertical.png b/textures/parts/DetacherVertical.png new file mode 100644 index 0000000..579e430 Binary files /dev/null and b/textures/parts/DetacherVertical.png differ diff --git a/textures/parts/DockingConnector.png b/textures/parts/DockingConnector.png new file mode 100644 index 0000000..c045017 Binary files /dev/null and b/textures/parts/DockingConnector.png differ diff --git a/textures/parts/DockingPort.png b/textures/parts/DockingPort.png new file mode 100644 index 0000000..0775dd1 Binary files /dev/null and b/textures/parts/DockingPort.png differ diff --git a/textures/parts/EngineIon.png b/textures/parts/EngineIon.png new file mode 100644 index 0000000..bfa21d2 Binary files /dev/null and b/textures/parts/EngineIon.png differ diff --git a/textures/parts/EngineLarge.png b/textures/parts/EngineLarge.png new file mode 100644 index 0000000..cf8e2a6 Binary files /dev/null and b/textures/parts/EngineLarge.png differ diff --git a/textures/parts/EngineMedium.png b/textures/parts/EngineMedium.png new file mode 100644 index 0000000..2b8121f Binary files /dev/null and b/textures/parts/EngineMedium.png differ diff --git a/textures/parts/EngineSmall.png b/textures/parts/EngineSmall.png new file mode 100644 index 0000000..25b3965 Binary files /dev/null and b/textures/parts/EngineSmall.png differ diff --git a/textures/parts/EngineTiny.png b/textures/parts/EngineTiny.png new file mode 100644 index 0000000..b90d5bc Binary files /dev/null and b/textures/parts/EngineTiny.png differ diff --git a/textures/parts/Fuselage.png b/textures/parts/Fuselage.png new file mode 100644 index 0000000..3e3127a Binary files /dev/null and b/textures/parts/Fuselage.png differ diff --git a/textures/parts/LanderLegJoint.png b/textures/parts/LanderLegJoint.png new file mode 100644 index 0000000..4eacd93 Binary files /dev/null and b/textures/parts/LanderLegJoint.png differ diff --git a/textures/parts/LanderLegLower.png b/textures/parts/LanderLegLower.png new file mode 100644 index 0000000..c885181 Binary files /dev/null and b/textures/parts/LanderLegLower.png differ diff --git a/textures/parts/LanderLegPreview.png b/textures/parts/LanderLegPreview.png new file mode 100644 index 0000000..0c099a8 Binary files /dev/null and b/textures/parts/LanderLegPreview.png differ diff --git a/textures/parts/LanderLegUpper.png b/textures/parts/LanderLegUpper.png new file mode 100644 index 0000000..0ea6f76 Binary files /dev/null and b/textures/parts/LanderLegUpper.png differ diff --git a/textures/parts/NoseCone.png b/textures/parts/NoseCone.png new file mode 100644 index 0000000..6dfb50d Binary files /dev/null and b/textures/parts/NoseCone.png differ diff --git a/textures/parts/Parachute.png b/textures/parts/Parachute.png new file mode 100644 index 0000000..0723ec0 Binary files /dev/null and b/textures/parts/Parachute.png differ diff --git a/textures/parts/ParachuteCanister.png b/textures/parts/ParachuteCanister.png new file mode 100644 index 0000000..bcbc569 Binary files /dev/null and b/textures/parts/ParachuteCanister.png differ diff --git a/textures/parts/ParachuteCanisterSide.png b/textures/parts/ParachuteCanisterSide.png new file mode 100644 index 0000000..8c37fd5 Binary files /dev/null and b/textures/parts/ParachuteCanisterSide.png differ diff --git a/textures/parts/Pod.png b/textures/parts/Pod.png new file mode 100644 index 0000000..4667880 Binary files /dev/null and b/textures/parts/Pod.png differ diff --git a/textures/parts/Puffy750.png b/textures/parts/Puffy750.png new file mode 100644 index 0000000..96a20e9 Binary files /dev/null and b/textures/parts/Puffy750.png differ diff --git a/textures/parts/RcsBlock.png b/textures/parts/RcsBlock.png new file mode 100644 index 0000000..541f72e Binary files /dev/null and b/textures/parts/RcsBlock.png differ diff --git a/textures/parts/SideTank.png b/textures/parts/SideTank.png new file mode 100644 index 0000000..73719e0 Binary files /dev/null and b/textures/parts/SideTank.png differ diff --git a/textures/parts/SolarPanel.png b/textures/parts/SolarPanel.png new file mode 100644 index 0000000..801335f Binary files /dev/null and b/textures/parts/SolarPanel.png differ diff --git a/textures/parts/SolarPanelBase.png b/textures/parts/SolarPanelBase.png new file mode 100644 index 0000000..8d65514 Binary files /dev/null and b/textures/parts/SolarPanelBase.png differ diff --git a/textures/parts/SolidRocketBooster.png b/textures/parts/SolidRocketBooster.png new file mode 100644 index 0000000..f8ed35c Binary files /dev/null and b/textures/parts/SolidRocketBooster.png differ diff --git a/textures/parts/TankLarge.png b/textures/parts/TankLarge.png new file mode 100644 index 0000000..6b46497 Binary files /dev/null and b/textures/parts/TankLarge.png differ diff --git a/textures/parts/TankMedium.png b/textures/parts/TankMedium.png new file mode 100644 index 0000000..178fe16 Binary files /dev/null and b/textures/parts/TankMedium.png differ diff --git a/textures/parts/TankSmall.png b/textures/parts/TankSmall.png new file mode 100644 index 0000000..2cb6236 Binary files /dev/null and b/textures/parts/TankSmall.png differ diff --git a/textures/parts/TankTiny.png b/textures/parts/TankTiny.png new file mode 100644 index 0000000..91bb288 Binary files /dev/null and b/textures/parts/TankTiny.png differ diff --git a/textures/parts/Wheel.png b/textures/parts/Wheel.png new file mode 100644 index 0000000..1526485 Binary files /dev/null and b/textures/parts/Wheel.png differ diff --git a/textures/parts/Wing.png b/textures/parts/Wing.png new file mode 100644 index 0000000..406f0ad Binary files /dev/null and b/textures/parts/Wing.png differ