simgame 0.2.0__tar.gz → 0.2.5__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.
- {simgame-0.2.0 → simgame-0.2.5}/PKG-INFO +4 -4
- {simgame-0.2.0 → simgame-0.2.5}/README.md +3 -2
- {simgame-0.2.0 → simgame-0.2.5}/pyproject.toml +1 -2
- {simgame-0.2.0 → simgame-0.2.5}/simgame/__init__.py +36 -7
- {simgame-0.2.0 → simgame-0.2.5}/simgame.egg-info/PKG-INFO +4 -4
- {simgame-0.2.0 → simgame-0.2.5}/setup.cfg +0 -0
- {simgame-0.2.0 → simgame-0.2.5}/simgame.egg-info/SOURCES.txt +0 -0
- {simgame-0.2.0 → simgame-0.2.5}/simgame.egg-info/dependency_links.txt +0 -0
- {simgame-0.2.0 → simgame-0.2.5}/simgame.egg-info/top_level.txt +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: simgame
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: A lightweight 2D game engine based on SDL2.
|
|
5
|
-
License: MIT
|
|
6
5
|
Description-Content-Type: text/markdown
|
|
7
6
|
|
|
8
7
|
# SimGame
|
|
9
8
|
> - **一个基于SDL2的轻量化 2D 游戏引擎 🎮**
|
|
10
9
|
> - **新增 2D 绘图功能**
|
|
10
|
+
> - **优化了画圆的Bug**
|
|
11
11
|
> - **可绘制方形,圆形,线**
|
|
12
12
|
## 安装:
|
|
13
13
|
```bash
|
|
14
|
-
pip install simgame
|
|
14
|
+
pip install simgame==0.2.5
|
|
15
15
|
```
|
|
16
16
|
## 快速上手:
|
|
17
17
|
```python
|
|
@@ -32,4 +32,4 @@ ctx.quit() #清理内存
|
|
|
32
32
|
## 关于作者(About):
|
|
33
33
|
> - **SimGame是一个轻量化的 2D 游戏引擎**
|
|
34
34
|
> - **制作人:钴蓝工作室🔵**
|
|
35
|
-
> - **版本:0.2.
|
|
35
|
+
> - **版本:0.2.5**
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# SimGame
|
|
2
2
|
> - **一个基于SDL2的轻量化 2D 游戏引擎 🎮**
|
|
3
3
|
> - **新增 2D 绘图功能**
|
|
4
|
+
> - **优化了画圆的Bug**
|
|
4
5
|
> - **可绘制方形,圆形,线**
|
|
5
6
|
## 安装:
|
|
6
7
|
```bash
|
|
7
|
-
pip install simgame
|
|
8
|
+
pip install simgame==0.2.5
|
|
8
9
|
```
|
|
9
10
|
## 快速上手:
|
|
10
11
|
```python
|
|
@@ -25,4 +26,4 @@ ctx.quit() #清理内存
|
|
|
25
26
|
## 关于作者(About):
|
|
26
27
|
> - **SimGame是一个轻量化的 2D 游戏引擎**
|
|
27
28
|
> - **制作人:钴蓝工作室🔵**
|
|
28
|
-
> - **版本:0.2.
|
|
29
|
+
> - **版本:0.2.5**
|
|
@@ -4,10 +4,9 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "simgame"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.5"
|
|
8
8
|
description = "A lightweight 2D game engine based on SDL2."
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
license = {text = "MIT"}
|
|
11
10
|
|
|
12
11
|
[tool.setuptools.packages.find]
|
|
13
12
|
include = ["simgame*"]
|
|
@@ -21,20 +21,49 @@ class _Draw:
|
|
|
21
21
|
sdl2.SDL_SetRenderDrawColor(self.renderer,r,g,b,255)
|
|
22
22
|
sdl_rect = sdl2.SDL_Rect(int(x),int(y),int(w),int(h))
|
|
23
23
|
if filled:
|
|
24
|
-
sdl2.SDL_RenderFillRect(sdl_rect)
|
|
24
|
+
sdl2.SDL_RenderFillRect(self.renderer,sdl_rect)
|
|
25
25
|
else:
|
|
26
|
-
sdl2.SDL_RenderDrawRect(sdl_rect)
|
|
26
|
+
sdl2.SDL_RenderDrawRect(self.renderer,sdl_rect)
|
|
27
27
|
def line(self,start,end,color):
|
|
28
28
|
x1,y1 = start
|
|
29
29
|
x2,y2 = end
|
|
30
30
|
r,g,b = color
|
|
31
31
|
sdl2.SDL_SetRenderDrawColor(self.renderer,r,g,b,255)
|
|
32
32
|
sdl2.SDL_RenderDrawLine(self.renderer,int(x1),int(y1),int(x2),int(y2))
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
|
|
34
|
+
def circle(self, center, radius, color, filled=False):
|
|
35
|
+
if radius <= 0:
|
|
36
|
+
return
|
|
37
|
+
cx, cy = int(center[0]), int(center[1])
|
|
38
|
+
r = int(radius)
|
|
39
|
+
red, green, blue = color
|
|
40
|
+
sdl2.SDL_SetRenderDrawColor(self.renderer, red, green, blue, 255)
|
|
41
|
+
if filled:
|
|
42
|
+
for y in range(-r, r + 1):
|
|
43
|
+
x_offset = int((r * r - y * y) ** 0.5)
|
|
44
|
+
sdl2.SDL_RenderDrawLine(
|
|
45
|
+
self.renderer,
|
|
46
|
+
cx - x_offset, cy + y,
|
|
47
|
+
cx + x_offset, cy + y
|
|
48
|
+
)
|
|
49
|
+
else:
|
|
50
|
+
x, y = 0, r
|
|
51
|
+
d = 3 - 2 * r
|
|
52
|
+
while x <= y:
|
|
53
|
+
points = [
|
|
54
|
+
(cx + x, cy + y), (cx - x, cy + y),
|
|
55
|
+
(cx + x, cy - y), (cx - x, cy - y),
|
|
56
|
+
(cx + y, cy + x), (cx - y, cy + x),
|
|
57
|
+
(cx + y, cy - x), (cx - y, cy - x)
|
|
58
|
+
]
|
|
59
|
+
for px, py in points:
|
|
60
|
+
sdl2.SDL_RenderDrawPoint(self.renderer, px, py)
|
|
61
|
+
if d < 0:
|
|
62
|
+
d = d + 4 * x + 6
|
|
63
|
+
else:
|
|
64
|
+
d = d + 4 * (x - y) + 10
|
|
65
|
+
y -= 1
|
|
66
|
+
x += 1
|
|
38
67
|
class _Input:
|
|
39
68
|
def __init__(self):
|
|
40
69
|
self.QUIT = sdl2.SDL_QUIT
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: simgame
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: A lightweight 2D game engine based on SDL2.
|
|
5
|
-
License: MIT
|
|
6
5
|
Description-Content-Type: text/markdown
|
|
7
6
|
|
|
8
7
|
# SimGame
|
|
9
8
|
> - **一个基于SDL2的轻量化 2D 游戏引擎 🎮**
|
|
10
9
|
> - **新增 2D 绘图功能**
|
|
10
|
+
> - **优化了画圆的Bug**
|
|
11
11
|
> - **可绘制方形,圆形,线**
|
|
12
12
|
## 安装:
|
|
13
13
|
```bash
|
|
14
|
-
pip install simgame
|
|
14
|
+
pip install simgame==0.2.5
|
|
15
15
|
```
|
|
16
16
|
## 快速上手:
|
|
17
17
|
```python
|
|
@@ -32,4 +32,4 @@ ctx.quit() #清理内存
|
|
|
32
32
|
## 关于作者(About):
|
|
33
33
|
> - **SimGame是一个轻量化的 2D 游戏引擎**
|
|
34
34
|
> - **制作人:钴蓝工作室🔵**
|
|
35
|
-
> - **版本:0.2.
|
|
35
|
+
> - **版本:0.2.5**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|