This commit is contained in:
沈瑗杰 2021-04-03 12:15:24 +08:00
parent 19a0b896fd
commit f94345472b
27 changed files with 119 additions and 108 deletions

View File

@ -9,6 +9,7 @@ QQ: 3695888"""
if __name__ == '__main__':
from bin import main
print(hi)
game = main.Game()
game.start()

View File

@ -20,18 +20,20 @@ None. Not even one!
## Environment (been tested / develop on)
- - `Develop platform 1 - Windows 10`
- `Python 3.8.7`
- `Windows10 x64`
- `Pyglet 1.5.15`
- `Json5 0.9.5`
- `pillow 8.1.0`
- - `Develop platform 2 - macOS Big Sur`
- `Python 3.8.7`
- `macOS Big Sur 11.2.1`
- `Pyglet 1.5.15`
- `Json5 0.9.5`
- `pillow 8.1.2`
-
- `Develop platform 1 - Windows 10`
- `Python 3.8.7`
- `Windows10 x64`
- `Pyglet 1.5.15`
- `Json5 0.9.5`
- `pillow 8.1.0`
-
- `Develop platform 2 - macOS Big Sur`
- `Python 3.8.7`
- `macOS Big Sur 11.2.1`
- `Pyglet 1.5.15`
- `Json5 0.9.5`
- `pillow 8.1.2`
## Required python modules
@ -64,15 +66,18 @@ The licensor cannot revoke these freedoms as long as you follow the license term
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You
may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
NonCommercial — You may not use the material for commercial purposes.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same
license as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from
doing anything the license permits.
Notices:

View File

@ -14,7 +14,10 @@ class Orbit_demo(threading.Thread):
# dic
self.ship_info = {'mass': [1, 5, ['kg'], []], 'force': []}
self.planet_system = {'Solar System': {'planets': {
'smearth': {'description': '', 'gravity': 9.81, 'radius': 63710000, 'map_color': [103, 157, 255]}}}}
'smearth': {'description': '', 'gravity': 9.81, 'radius': 63710000, 'map_color': [103, 157, 255]}
}
}
}
self.this_planet_info = {}
self.back_ground_element = {}
self.back_ground_image = ''

View File

@ -6,9 +6,3 @@ mail: 3695888@qq.com
#
# import in this folder
import bin.main
import bin.tools
import bin.client
import bin.server
import bin.configs
import bin.delivery

View File

@ -5,6 +5,7 @@ mail: 3695888@qq.com
import os
import sys
sys.path.append('./bin/libs/')
sys.path.append('./')
import time

View File

@ -3,13 +3,14 @@ writen by shenjackyuanjie
mail: 3695888@qq.com
"""
import decimal
import logging
# import re
import os
import sys
import time
import json5
import decimal
import logging
sys.path.append('./')
try:
@ -137,29 +138,17 @@ def configs(name, option=None) -> dict:
return data
names = {'{time.time}': str(time.time()),
'{dir}': str(os.getcwd()),
'{py_v}': str(sys.version.split(' ')[0])}
def default_name_handler(name: str) -> str:
"""
won't change the string
just return one
"""
name = name
name = name.replace('{time.time}', str(time.time()))
name = name.replace('{dir}', str(os.getcwd()))
name = name.replace('{py_v}', str(sys.version.split(' ')[0]))
return name
name_handlers = {'{time.time}': str(time.time()),
'{dir}': str(os.getcwd()),
'{py_v}': str(sys.version.split(' ')[0])
}
def name_handler(name: str, configs=None) -> str:
names = configs
names = names.update(name_handlers)
print(names)
handler_name = name.format(names)
if configs is None:
return default_name_handler(name)
name = default_name_handler(name)
for need_replace in configs:
replace = configs[need_replace]
if need_replace == '{date}':
replace = time.strftime(configs['{date}'], time.gmtime(time.time()))
name = name.replace(need_replace, replace)
return handler_name
return name

View File

@ -14,10 +14,9 @@
"""A pure Python implementation of the JSON5 configuration language."""
from .lib import load, loads, dump, dumps
from .lib import dump, dumps, load, loads
from .version import VERSION
__all__ = [
'VERSION',
'dump',

View File

@ -16,6 +16,5 @@ import sys # pragma: no cover
from .tool import main # pragma: no cover
if __name__ == '__main__': # pragma: no cover
sys.exit(main())

View File

@ -17,7 +17,6 @@ import shutil
import sys
import tempfile
if sys.version_info[0] < 3:
# pylint: disable=redefined-builtin, invalid-name
str = unicode

View File

@ -19,7 +19,6 @@ import unicodedata
from .parser import Parser
if sys.version_info[0] < 3:
str = unicode # pylint: disable=redefined-builtin, invalid-name
else:
@ -87,7 +86,7 @@ def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None,
elif object_hook:
dictify = lambda pairs: object_hook(dict(pairs))
else:
dictify = lambda pairs: dict(pairs) # pylint: disable=unnecessary-lambda
dictify = lambda pairs: dict(pairs) # pylint: disable=unnecessary-lambda
if not allow_duplicate_keys:
_orig_dictify = dictify
@ -108,6 +107,7 @@ def _reject_duplicate_keys(pairs, dictify):
keys.add(key)
return dictify(pairs)
def _walk_ast(el, dictify, parse_float, parse_int, parse_constant):
if el == 'None':
return None
@ -251,11 +251,11 @@ def _dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, indent,
t = type(obj)
if t == type('') or t == type(u''):
if (is_key and _is_ident(obj) and not quote_keys
and not _is_reserved_word(obj)):
and not _is_reserved_word(obj)):
return True, obj
return True, _dump_str(obj, ensure_ascii)
if t is float:
s = _dump_float(obj,allow_nan)
s = _dump_float(obj, allow_nan)
if t is int:
s = str(obj)
@ -459,6 +459,7 @@ def _is_id_continue(ch):
_reserved_word_re = None
def _is_reserved_word(k):
global _reserved_word_re

View File

@ -2,7 +2,6 @@
import sys
if sys.version_info[0] < 3:
# pylint: disable=redefined-builtin,invalid-name
chr = unichr

View File

@ -3,13 +3,12 @@ writen by shenjackyuanjie
mail: 3695888@qq.com
"""
# share memory
from multiprocessing import Manager as share
import logging
import os
import sys
import time
import logging
# share memory
from multiprocessing import Manager as share
sys.path.append('./')
try:

View File

@ -3,8 +3,8 @@ writen by shenjackyuanjie
mail: 3695888@qq.com
"""
import os
import multiprocessing as mp
import os
try:
from bin import tools

View File

@ -3,13 +3,13 @@ writen by shenjackyuanjie
mail: 3695888@qq.com
"""
import re
import math
import json5
import decimal
import logging
import math
from xml.dom.minidom import parse
import json5
try:
import configs
except ModuleNotFoundError:
@ -51,9 +51,10 @@ def log_level(level):
else:
raise ValueError('Need a like level thing not anything else')
# linear_algebra
def C_R_P(position, degrees): # stand for calculation
def C_R_P(position, degrees): # stand for calculation
"""
very thanks for lenny from pyglet delvoper
https://github.com/LennyPhoenix

View File

@ -8,8 +8,9 @@ try:
except (ModuleNotFoundError, ImportError, ImportWarning):
import tools
import os
import json5
import PIL.Image
import json5
def rewrite_config(name, save_name):
@ -53,4 +54,3 @@ def All_in_one_cut(xml, path):
json_name = xml[:-4] + '.json5'
rewrite_config(xml, json_name)
cut_and_save(json_name, path)

View File

@ -1,3 +1,2 @@
{
}

View File

@ -43,9 +43,25 @@
],
*/
test1: [
['test1', '一个测试用部件'],
[1.0, false, 0.1],
['parts/Beam.png', [0.0, 0.0]],
[3.0, 2.0]
[
'test1',
'一个测试用部件'
],
[
1.0,
false,
0.1
],
[
'parts/Beam.png',
[
0.0,
0.0
]
],
[
3.0,
2.0
]
]
}

View File

@ -1,3 +1,3 @@
{
'map far': 100
'map far': 100
}

View File

@ -20,18 +20,20 @@ For an English version of readme, please move [here](..).
## 环境需求 (测试过的/开发平台)
- - `开发平台1 Windows 10`
- `Python 3.8.7`
- `Windows10 x64`
- `Pyglet 1.5.15`
- `Json5 0.9.5`
- `pillow 8.1.0`
- - `开发平台2 macOS Big Sur`
- `Python 3.8.7`
- `macOS Big Sur 11.2.1`
- `Pyglet 1.5.15`
- `Json5 0.9.5`
- `pillow 8.1.2`
-
- `开发平台1 Windows 10`
- `Python 3.8.7`
- `Windows10 x64`
- `Pyglet 1.5.15`
- `Json5 0.9.5`
- `pillow 8.1.0`
-
- `开发平台2 macOS Big Sur`
- `Python 3.8.7`
- `macOS Big Sur 11.2.1`
- `Pyglet 1.5.15`
- `Json5 0.9.5`
- `pillow 8.1.2`
## 需要的Python模块

View File

@ -8,7 +8,12 @@
}
},
client: {
'self.view': ['space', 'map', 'menu', 'build'],
'self.view': [
'space',
'map',
'menu',
'build'
],
'self.textures': {
'first name of textures(defaut: difficult_rocket)': {
'name of image or name of list': 'pyglet.image class or dict',
@ -29,7 +34,10 @@
// type:float
'is mirror',
// type:bool
['basic_config.basic_poi', 'basic_config.basic_poi']
[
'basic_config.basic_poi',
'basic_config.basic_poi'
]
/*brain的坐标记录由两部分组成
第一部分是brain所在区块的区块坐标(区块的大小暂定2^64m大小从恒星中心开始算普通的平面直角坐标系)
第二部分是brain所在区块内的相对坐标(左上角00)*/
@ -48,7 +56,9 @@
// type:float 0 is up clockwise
'is mirror',
// type:bool
['basic_config.basic_poi'],
[
'basic_config.basic_poi'
],
{
'special value 1': 'xxx',
'special value 2': 'xxx',

View File

@ -5,8 +5,8 @@
### Add
- local libs
- `pyglet 1.5.15`
- `json 0.9.5`
- `pyglet 1.5.15`
- `json 0.9.5`
PS: now I'm not sure witch lib will be import first

View File

@ -1,4 +1,3 @@
"""
这个测试主要是为了测试关于旋转的按钮碰撞箱判定的
感谢孙老师/
@ -6,7 +5,6 @@
"""
import turtle
import random
t = turtle
@ -14,6 +12,7 @@ size = t.screensize()
screen = t.Screen()
def print_poi(x, y):
print(x, y)
this_t = turtle.clone()
@ -24,12 +23,13 @@ def print_poi(x, y):
this_t.pendown()
this_t.goto(x, -size[1])
t.speed = 0
t.hideturtle()
screen.onclick(print_poi)
t.onclick(print_poi)
t.goto(10,10)
t.goto(20,100)
t.done()
t.goto(10, 10)
t.goto(20, 100)
t.done()

View File

@ -3,9 +3,10 @@ writen by shenjackyuanjie
mail: 3695888@qq.com
"""
import bin
import decimal
import bin
A = [2.573, 3, ['m', 'kg'], ['N', 's']]
B = [2.45, -7, ['N', 'kg'], ['m', 's']]
C = [1.14, 5, ['m'], ['s']]
@ -16,7 +17,6 @@ print('B = ', B)
print('C = ', C)
print('D = ', D)
a = bin.tools.S_N_M(A, B)
b = bin.tools.S_N_D(A, B)
c = bin.tools.S_N_M(b, B)

View File

@ -1,8 +1,5 @@
import json5
import pprint
with open('sys_value/parts.json5', 'r+', encoding='utf-8') as view:
a = view.read()
pprint.pprint(a)
pprint.pprint(a)

View File

@ -1,4 +1,3 @@
import logging
# set up logging to file - see previous section for more details

View File

@ -1,9 +1,8 @@
import multiprocessing as mp
from multiprocessing.context import Process
import os
import time
import random
import time
from multiprocessing.context import Process
class Main(mp.Process):
@ -17,7 +16,7 @@ class Main(mp.Process):
while self.ttt:
print(os.getpid())
time.sleep(2)
while not(self.dev.using):
while not (self.dev.using):
self.dev.using = True
print('开始调用a')
if self.dev.dev1 != 0:
@ -47,7 +46,7 @@ class render(mp.Process):
while self.ggg:
print(os.getpid())
time.sleep(2)
while not(self.dev.using):
while not (self.dev.using):
self.dev.using = True
if random.choice(range(0, 5, 1)) == 4:
self.dev.dev1 = self.bbb

View File

@ -1,8 +1,7 @@
import os
import random
import threading
import time
import os
import sys
import random
class Aclass(threading.Thread):