NexusFine 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: NexusFine
3
+ Version: 0.1.0
4
+ Summary: AI驱动的物理游戏引擎 - 聚合设计
5
+ Home-page: https://github.com/yourusername/NexusFine
6
+ Author: Bengtiaotiao
7
+ Author-email: 1020tldl@163.com
8
+ Project-URL: Bug Reports, https://github.com/yourusername/NexusFine/issues
9
+ Project-URL: Source, https://github.com/yourusername/NexusFine
10
+ Keywords: game physics ai game-engine
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Games/Entertainment
17
+ Requires-Python: >=3.6
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: requests>=2.25.0
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: project-url
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # NexusFine - AI驱动的物理游戏引擎
33
+
34
+ ## 快速开始
35
+
36
+ ```python
37
+ from NexusFine import NF
38
+
39
+ a = "SK-123456"
40
+
41
+ NF.(a)
42
+ NF.(a)
43
+ NF(a, a)
44
+ NF(a)
45
+ NF("Game.exe")
46
+ ```
@@ -0,0 +1,10 @@
1
+ README.md
2
+ setup.py
3
+ NexusFine.egg-info/PKG-INFO
4
+ NexusFine.egg-info/SOURCES.txt
5
+ NexusFine.egg-info/dependency_links.txt
6
+ NexusFine.egg-info/requires.txt
7
+ NexusFine.egg-info/top_level.txt
8
+ nexusfine/__init__.py
9
+ nexusfine/core.py
10
+ nexusfine/physics.py
@@ -0,0 +1 @@
1
+ requests>=2.25.0
@@ -0,0 +1 @@
1
+ nexusfine
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: NexusFine
3
+ Version: 0.1.0
4
+ Summary: AI驱动的物理游戏引擎 - 聚合设计
5
+ Home-page: https://github.com/yourusername/NexusFine
6
+ Author: Bengtiaotiao
7
+ Author-email: 1020tldl@163.com
8
+ Project-URL: Bug Reports, https://github.com/yourusername/NexusFine/issues
9
+ Project-URL: Source, https://github.com/yourusername/NexusFine
10
+ Keywords: game physics ai game-engine
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Games/Entertainment
17
+ Requires-Python: >=3.6
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: requests>=2.25.0
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: project-url
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # NexusFine - AI驱动的物理游戏引擎
33
+
34
+ ## 快速开始
35
+
36
+ ```python
37
+ from NexusFine import NF
38
+
39
+ a = "SK-123456"
40
+
41
+ NF.(a)
42
+ NF.(a)
43
+ NF(a, a)
44
+ NF(a)
45
+ NF("Game.exe")
46
+ ```
@@ -0,0 +1,15 @@
1
+ # NexusFine - AI驱动的物理游戏引擎
2
+
3
+ ## 快速开始
4
+
5
+ ```python
6
+ from NexusFine import NF
7
+
8
+ a = "SK-123456"
9
+
10
+ NF.(a)
11
+ NF.(a)
12
+ NF(a, a)
13
+ NF(a)
14
+ NF("Game.exe")
15
+ ```
@@ -0,0 +1,3 @@
1
+ from .core import NF, NB, NC, NS
2
+
3
+ __all__ = ['NF', 'NB', 'NC', 'NS']
@@ -0,0 +1,70 @@
1
+ import requests
2
+ import random
3
+ from .physics import Bullet, Ball, Cloud, Steam
4
+
5
+
6
+ class NexusEngine:
7
+ def __init__(self, name="NexusFine"):
8
+ self.name = name
9
+ self.api_key = None
10
+ self.axes = []
11
+ self.game_name = None
12
+ self.api_url = "https://api.nexusfine.ai/v1"
13
+ self.system_dims = 0
14
+
15
+ def __call__(self, *args):
16
+ if len(args) == 0:
17
+ return self
18
+ if len(args) == 1 and isinstance(args[0], str):
19
+ arg = args[0]
20
+ if arg.endswith('.exe'):
21
+ self.game_name = arg
22
+ self._start_game()
23
+ return self
24
+ if arg.startswith('SK-'):
25
+ self.api_key = arg
26
+ print(f"✅ API: {self.api_key[:10]}...")
27
+ return self
28
+ # 注册轴
29
+ if arg not in self.axes:
30
+ self.axes.append(arg)
31
+ label = ['X', 'Y', 'Z'][len(self.axes)-1] if len(self.axes) <= 3 else str(len(self.axes))
32
+ print(f"📐 {label}轴: {arg}")
33
+ return self
34
+ if len(args) >= 2:
35
+ self.system_dims = len([x for x in args if x is not None])
36
+ print(f"🎯 {self.system_dims}D系统")
37
+ return self
38
+
39
+ def _start_game(self):
40
+ print(f"\n🎮 {self.game_name}")
41
+ print(f"📐 {self.system_dims}D")
42
+ print(f"📊 {self.axes}\n")
43
+ if self.api_key:
44
+ try:
45
+ requests.post(f"{self.api_url}/init",
46
+ headers={"Authorization": f"Bearer {self.api_key}"},
47
+ json={"game": self.game_name, "axes": self.axes},
48
+ timeout=5)
49
+ print("✅ AI引擎就绪")
50
+ except:
51
+ print("⚠️ 本地引擎")
52
+ else:
53
+ print("⚠️ 本地引擎")
54
+
55
+ def Bullet(self, **kw):
56
+ return Bullet(self, **kw)
57
+ def Ball(self, **kw):
58
+ return Ball(self, **kw)
59
+ def Cloud(self, **kw):
60
+ return Cloud(self, **kw)
61
+ def Steam(self, **kw):
62
+ return Steam(self, **kw)
63
+
64
+
65
+ NF = NexusEngine("NexusFine")
66
+ NB = NexusEngine("NexusBall")
67
+ NC = NexusEngine("NexusCloud")
68
+ NS = NexusEngine("NexusSteam")
69
+
70
+ __all__ = ['NF', 'NB', 'NC', 'NS']
@@ -0,0 +1,86 @@
1
+ """
2
+ 物理对象
3
+ """
4
+
5
+ import random
6
+
7
+ class Bullet:
8
+ """子弹 - 2D直线运动"""
9
+
10
+ def __init__(self, engine, start_x=0, start_y=0, velocity_x=5, velocity_y=-9.8):
11
+ self.engine = engine
12
+ self.x = start_x
13
+ self.y = start_y
14
+ self.vx = velocity_x
15
+ self.vy = velocity_y
16
+
17
+ def update(self, dt=0.016):
18
+ self.x += self.vx * dt
19
+ self.y += self.vy * dt
20
+ self.vy -= 9.8 * dt
21
+ return {"x": self.x, "y": self.y}
22
+
23
+ def __repr__(self):
24
+ return f"Bullet(x={self.x:.2f}, y={self.y:.2f})"
25
+
26
+
27
+ class Ball:
28
+ """球 - 2D弹跳运动"""
29
+
30
+ def __init__(self, engine, x=0, y=5, radius=1):
31
+ self.engine = engine
32
+ self.x = x
33
+ self.y = y
34
+ self.radius = radius
35
+ self.vx = 2
36
+ self.vy = 0
37
+
38
+ def update(self, dt=0.016):
39
+ self.x += self.vx * dt
40
+ self.y += self.vy * dt
41
+ self.vy += 9.8 * dt
42
+ if self.y < 0:
43
+ self.y = 0
44
+ self.vy = -self.vy * 0.8
45
+ return {"x": self.x, "y": self.y}
46
+
47
+ def __repr__(self):
48
+ return f"Ball(x={self.x:.2f}, y={self.y:.2f})"
49
+
50
+
51
+ class Cloud:
52
+ """云 - 2D飘动"""
53
+
54
+ def __init__(self, engine, x=0, y=5):
55
+ self.engine = engine
56
+ self.x = x
57
+ self.y = y
58
+ self.vx = 0.5
59
+
60
+ def update(self, dt=0.016):
61
+ self.x += self.vx * dt
62
+ return {"x": self.x, "y": self.y}
63
+
64
+ def __repr__(self):
65
+ return f"Cloud(x={self.x:.2f}, y={self.y:.2f})"
66
+
67
+
68
+ class Steam:
69
+ """蒸汽 - 3D扩散(需要3个轴)"""
70
+
71
+ def __init__(self, engine, x=0, y=0, z=0):
72
+ if len(engine.axes) < 3:
73
+ print("⚠️ 蒸汽需要3个轴 (X, Y, Z)")
74
+ self.engine = engine
75
+ self.x = x
76
+ self.y = y
77
+ self.z = z
78
+
79
+ def update(self, dt=0.016):
80
+ self.x += random.uniform(-0.3, 0.3) * dt * 10
81
+ self.y += 0.5 * dt * 10
82
+ self.z += random.uniform(-0.3, 0.3) * dt * 10
83
+ return {"x": self.x, "y": self.y, "z": self.z}
84
+
85
+ def __repr__(self):
86
+ return f"Steam(x={self.x:.2f}, y={self.y:.2f}, z={self.z:.2f})"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,33 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r", encoding="utf-8") as fh:
4
+ long_description = fh.read()
5
+
6
+ setup(
7
+ name="NexusFine", # 包名(pip install 用的)
8
+ version="0.1.0", # 版本号
9
+ author="Bengtiaotiao", # 你的名字
10
+ author_email="1020tldl@163.com",
11
+ description="AI驱动的物理游戏引擎 - 聚合设计",
12
+ long_description=long_description,
13
+ long_description_content_type="text/markdown",
14
+ url="https://github.com/yourusername/NexusFine", # 你的GitHub
15
+ packages=find_packages(),
16
+ classifiers=[
17
+ "Programming Language :: Python :: 3",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Development Status :: 3 - Alpha",
21
+ "Intended Audience :: Developers",
22
+ "Topic :: Games/Entertainment",
23
+ ],
24
+ python_requires=">=3.6",
25
+ install_requires=[
26
+ "requests>=2.25.0", # 依赖 requests
27
+ ],
28
+ keywords="game physics ai game-engine",
29
+ project_urls={
30
+ "Bug Reports": "https://github.com/yourusername/NexusFine/issues",
31
+ "Source": "https://github.com/yourusername/NexusFine",
32
+ },
33
+ )