moonframe-engine 1.0.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.
- moonframe_engine-1.0.0/LICENSE +0 -0
- moonframe_engine-1.0.0/PKG-INFO +119 -0
- moonframe_engine-1.0.0/README.md +96 -0
- moonframe_engine-1.0.0/moonframe_engine.egg-info/PKG-INFO +119 -0
- moonframe_engine-1.0.0/moonframe_engine.egg-info/SOURCES.txt +8 -0
- moonframe_engine-1.0.0/moonframe_engine.egg-info/dependency_links.txt +1 -0
- moonframe_engine-1.0.0/moonframe_engine.egg-info/requires.txt +1 -0
- moonframe_engine-1.0.0/moonframe_engine.egg-info/top_level.txt +1 -0
- moonframe_engine-1.0.0/setup.cfg +4 -0
- moonframe_engine-1.0.0/setup.py +24 -0
|
File without changes
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: moonframe-engine
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A lightweight 2D game engine built on Pyglet
|
|
5
|
+
Home-page: https://github.com/YourUsername/MoonFrame
|
|
6
|
+
Author: Samin
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: pyglet
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: classifier
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: description-content-type
|
|
18
|
+
Dynamic: home-page
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
Dynamic: requires-dist
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
23
|
+
|
|
24
|
+
# MoonFrame
|
|
25
|
+
|
|
26
|
+
MoonFrame is a Python game development framework built on top of Pyglet. It provides a simple and intuitive API for creating 2D games, handling graphics, input, and more. Its kinda like a mix between Pygame and SDL2, but with a more modern and Python design. This README will give you a quick overview of how to get started with MoonFrame and what features it offers.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
You can install MoonFrame using pip:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install moonframe
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Basic Usage
|
|
36
|
+
Here's a simple example of how to create a window and render a texture with controls using MoonFrame:
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
import moonframe as mfr
|
|
40
|
+
|
|
41
|
+
class GameApp:
|
|
42
|
+
def __init__(self, renderer, input_handler):
|
|
43
|
+
self.renderer = renderer
|
|
44
|
+
self.input = input_handler
|
|
45
|
+
self.x, self.y = 100, 100
|
|
46
|
+
|
|
47
|
+
# Load a texture
|
|
48
|
+
self.cat = mfr.Texture(renderer, "cat.avif", x=self.x, y=self.y)
|
|
49
|
+
self.cat.resize(128, 128)
|
|
50
|
+
|
|
51
|
+
def update(self):
|
|
52
|
+
if self.input.is_key_pressed('right'): self.x += 5
|
|
53
|
+
if self.input.is_key_pressed('down'): self.y += 5
|
|
54
|
+
if self.input.is_key_pressed('up'): self.y -= 5
|
|
55
|
+
if self.input.is_key_pressed('left'): self.x -= 5
|
|
56
|
+
|
|
57
|
+
self.cat.set_pos(self.x, self.y)
|
|
58
|
+
|
|
59
|
+
def draw(self):
|
|
60
|
+
self.renderer.set_draw_color(20, 20, 30)
|
|
61
|
+
self.renderer.clear()
|
|
62
|
+
|
|
63
|
+
win = mfr.Window(800, 600, "MoonFrame Test")
|
|
64
|
+
renderer = mfr.Renderer(win)
|
|
65
|
+
event = mfr.Event()
|
|
66
|
+
input_handler = mfr.Input(win)
|
|
67
|
+
app = GameApp(renderer, input_handler)
|
|
68
|
+
|
|
69
|
+
running = True
|
|
70
|
+
while running:
|
|
71
|
+
while win.poll_event(win, event):
|
|
72
|
+
if event.type == event.QUIT:
|
|
73
|
+
running = False
|
|
74
|
+
break
|
|
75
|
+
|
|
76
|
+
if not running:
|
|
77
|
+
break
|
|
78
|
+
|
|
79
|
+
app.update()
|
|
80
|
+
app.draw()
|
|
81
|
+
renderer.present()
|
|
82
|
+
|
|
83
|
+
win.handle.close()
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Features
|
|
87
|
+
- **Window Management**: Create and manage game windows with ease.
|
|
88
|
+
- **Rendering**: Draw textures, shapes, and more with a simple API.
|
|
89
|
+
- **Input Handling**: Capture keyboard and mouse input for interactive games.
|
|
90
|
+
- **Event System**: Handle events like window resizing, quitting, and custom events.
|
|
91
|
+
- **Collision Detection**: Built-in support for detecting collisions between game objects.
|
|
92
|
+
|
|
93
|
+
## Methods and Classes
|
|
94
|
+
- `Window`: Create and manage game windows.
|
|
95
|
+
- `Renderer`: Handle all rendering operations.
|
|
96
|
+
- `Texture`: Load and manipulate textures.
|
|
97
|
+
- `Input`: Capture and process user input.
|
|
98
|
+
- `Drawable`: Base class for drawable objects.
|
|
99
|
+
- `Event`: Handle various events in the game loop.
|
|
100
|
+
- `Collision`: Utility class for collision detection and response.
|
|
101
|
+
|
|
102
|
+
### Methods
|
|
103
|
+
- `Window.poll_event()`: Poll for events from the window.
|
|
104
|
+
- `Renderer.set_draw_color()`: Set the color for drawing operations.
|
|
105
|
+
- `Renderer.clear()`: Clear the rendering target.
|
|
106
|
+
- `Texture.resize()`: Resize a texture to specified dimensions.
|
|
107
|
+
- `Texture.set_pos()`: Set the position of a texture.
|
|
108
|
+
- `Input.is_key_pressed()`: Check if a specific key is currently pressed.
|
|
109
|
+
- `Collision.is_colliding()`: Check for collisions between two objects.
|
|
110
|
+
- And many more!
|
|
111
|
+
|
|
112
|
+
## Contributing
|
|
113
|
+
Contributions to MoonFrame are welcome! If you have an idea for a new feature or want to fix a bug, please open an issue or submit a pull request on GitHub.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
MoonFrame is licensed under the MIT License. See the LICENSE file for more details.
|
|
117
|
+
|
|
118
|
+
## Version History
|
|
119
|
+
- **1.0.0** - Initial release with basic window management, rendering, and input handling.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# MoonFrame
|
|
2
|
+
|
|
3
|
+
MoonFrame is a Python game development framework built on top of Pyglet. It provides a simple and intuitive API for creating 2D games, handling graphics, input, and more. Its kinda like a mix between Pygame and SDL2, but with a more modern and Python design. This README will give you a quick overview of how to get started with MoonFrame and what features it offers.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
You can install MoonFrame using pip:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install moonframe
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Basic Usage
|
|
13
|
+
Here's a simple example of how to create a window and render a texture with controls using MoonFrame:
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
import moonframe as mfr
|
|
17
|
+
|
|
18
|
+
class GameApp:
|
|
19
|
+
def __init__(self, renderer, input_handler):
|
|
20
|
+
self.renderer = renderer
|
|
21
|
+
self.input = input_handler
|
|
22
|
+
self.x, self.y = 100, 100
|
|
23
|
+
|
|
24
|
+
# Load a texture
|
|
25
|
+
self.cat = mfr.Texture(renderer, "cat.avif", x=self.x, y=self.y)
|
|
26
|
+
self.cat.resize(128, 128)
|
|
27
|
+
|
|
28
|
+
def update(self):
|
|
29
|
+
if self.input.is_key_pressed('right'): self.x += 5
|
|
30
|
+
if self.input.is_key_pressed('down'): self.y += 5
|
|
31
|
+
if self.input.is_key_pressed('up'): self.y -= 5
|
|
32
|
+
if self.input.is_key_pressed('left'): self.x -= 5
|
|
33
|
+
|
|
34
|
+
self.cat.set_pos(self.x, self.y)
|
|
35
|
+
|
|
36
|
+
def draw(self):
|
|
37
|
+
self.renderer.set_draw_color(20, 20, 30)
|
|
38
|
+
self.renderer.clear()
|
|
39
|
+
|
|
40
|
+
win = mfr.Window(800, 600, "MoonFrame Test")
|
|
41
|
+
renderer = mfr.Renderer(win)
|
|
42
|
+
event = mfr.Event()
|
|
43
|
+
input_handler = mfr.Input(win)
|
|
44
|
+
app = GameApp(renderer, input_handler)
|
|
45
|
+
|
|
46
|
+
running = True
|
|
47
|
+
while running:
|
|
48
|
+
while win.poll_event(win, event):
|
|
49
|
+
if event.type == event.QUIT:
|
|
50
|
+
running = False
|
|
51
|
+
break
|
|
52
|
+
|
|
53
|
+
if not running:
|
|
54
|
+
break
|
|
55
|
+
|
|
56
|
+
app.update()
|
|
57
|
+
app.draw()
|
|
58
|
+
renderer.present()
|
|
59
|
+
|
|
60
|
+
win.handle.close()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Features
|
|
64
|
+
- **Window Management**: Create and manage game windows with ease.
|
|
65
|
+
- **Rendering**: Draw textures, shapes, and more with a simple API.
|
|
66
|
+
- **Input Handling**: Capture keyboard and mouse input for interactive games.
|
|
67
|
+
- **Event System**: Handle events like window resizing, quitting, and custom events.
|
|
68
|
+
- **Collision Detection**: Built-in support for detecting collisions between game objects.
|
|
69
|
+
|
|
70
|
+
## Methods and Classes
|
|
71
|
+
- `Window`: Create and manage game windows.
|
|
72
|
+
- `Renderer`: Handle all rendering operations.
|
|
73
|
+
- `Texture`: Load and manipulate textures.
|
|
74
|
+
- `Input`: Capture and process user input.
|
|
75
|
+
- `Drawable`: Base class for drawable objects.
|
|
76
|
+
- `Event`: Handle various events in the game loop.
|
|
77
|
+
- `Collision`: Utility class for collision detection and response.
|
|
78
|
+
|
|
79
|
+
### Methods
|
|
80
|
+
- `Window.poll_event()`: Poll for events from the window.
|
|
81
|
+
- `Renderer.set_draw_color()`: Set the color for drawing operations.
|
|
82
|
+
- `Renderer.clear()`: Clear the rendering target.
|
|
83
|
+
- `Texture.resize()`: Resize a texture to specified dimensions.
|
|
84
|
+
- `Texture.set_pos()`: Set the position of a texture.
|
|
85
|
+
- `Input.is_key_pressed()`: Check if a specific key is currently pressed.
|
|
86
|
+
- `Collision.is_colliding()`: Check for collisions between two objects.
|
|
87
|
+
- And many more!
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
Contributions to MoonFrame are welcome! If you have an idea for a new feature or want to fix a bug, please open an issue or submit a pull request on GitHub.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
MoonFrame is licensed under the MIT License. See the LICENSE file for more details.
|
|
94
|
+
|
|
95
|
+
## Version History
|
|
96
|
+
- **1.0.0** - Initial release with basic window management, rendering, and input handling.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: moonframe-engine
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A lightweight 2D game engine built on Pyglet
|
|
5
|
+
Home-page: https://github.com/YourUsername/MoonFrame
|
|
6
|
+
Author: Samin
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: pyglet
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: classifier
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: description-content-type
|
|
18
|
+
Dynamic: home-page
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
Dynamic: requires-dist
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
23
|
+
|
|
24
|
+
# MoonFrame
|
|
25
|
+
|
|
26
|
+
MoonFrame is a Python game development framework built on top of Pyglet. It provides a simple and intuitive API for creating 2D games, handling graphics, input, and more. Its kinda like a mix between Pygame and SDL2, but with a more modern and Python design. This README will give you a quick overview of how to get started with MoonFrame and what features it offers.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
You can install MoonFrame using pip:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install moonframe
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Basic Usage
|
|
36
|
+
Here's a simple example of how to create a window and render a texture with controls using MoonFrame:
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
import moonframe as mfr
|
|
40
|
+
|
|
41
|
+
class GameApp:
|
|
42
|
+
def __init__(self, renderer, input_handler):
|
|
43
|
+
self.renderer = renderer
|
|
44
|
+
self.input = input_handler
|
|
45
|
+
self.x, self.y = 100, 100
|
|
46
|
+
|
|
47
|
+
# Load a texture
|
|
48
|
+
self.cat = mfr.Texture(renderer, "cat.avif", x=self.x, y=self.y)
|
|
49
|
+
self.cat.resize(128, 128)
|
|
50
|
+
|
|
51
|
+
def update(self):
|
|
52
|
+
if self.input.is_key_pressed('right'): self.x += 5
|
|
53
|
+
if self.input.is_key_pressed('down'): self.y += 5
|
|
54
|
+
if self.input.is_key_pressed('up'): self.y -= 5
|
|
55
|
+
if self.input.is_key_pressed('left'): self.x -= 5
|
|
56
|
+
|
|
57
|
+
self.cat.set_pos(self.x, self.y)
|
|
58
|
+
|
|
59
|
+
def draw(self):
|
|
60
|
+
self.renderer.set_draw_color(20, 20, 30)
|
|
61
|
+
self.renderer.clear()
|
|
62
|
+
|
|
63
|
+
win = mfr.Window(800, 600, "MoonFrame Test")
|
|
64
|
+
renderer = mfr.Renderer(win)
|
|
65
|
+
event = mfr.Event()
|
|
66
|
+
input_handler = mfr.Input(win)
|
|
67
|
+
app = GameApp(renderer, input_handler)
|
|
68
|
+
|
|
69
|
+
running = True
|
|
70
|
+
while running:
|
|
71
|
+
while win.poll_event(win, event):
|
|
72
|
+
if event.type == event.QUIT:
|
|
73
|
+
running = False
|
|
74
|
+
break
|
|
75
|
+
|
|
76
|
+
if not running:
|
|
77
|
+
break
|
|
78
|
+
|
|
79
|
+
app.update()
|
|
80
|
+
app.draw()
|
|
81
|
+
renderer.present()
|
|
82
|
+
|
|
83
|
+
win.handle.close()
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Features
|
|
87
|
+
- **Window Management**: Create and manage game windows with ease.
|
|
88
|
+
- **Rendering**: Draw textures, shapes, and more with a simple API.
|
|
89
|
+
- **Input Handling**: Capture keyboard and mouse input for interactive games.
|
|
90
|
+
- **Event System**: Handle events like window resizing, quitting, and custom events.
|
|
91
|
+
- **Collision Detection**: Built-in support for detecting collisions between game objects.
|
|
92
|
+
|
|
93
|
+
## Methods and Classes
|
|
94
|
+
- `Window`: Create and manage game windows.
|
|
95
|
+
- `Renderer`: Handle all rendering operations.
|
|
96
|
+
- `Texture`: Load and manipulate textures.
|
|
97
|
+
- `Input`: Capture and process user input.
|
|
98
|
+
- `Drawable`: Base class for drawable objects.
|
|
99
|
+
- `Event`: Handle various events in the game loop.
|
|
100
|
+
- `Collision`: Utility class for collision detection and response.
|
|
101
|
+
|
|
102
|
+
### Methods
|
|
103
|
+
- `Window.poll_event()`: Poll for events from the window.
|
|
104
|
+
- `Renderer.set_draw_color()`: Set the color for drawing operations.
|
|
105
|
+
- `Renderer.clear()`: Clear the rendering target.
|
|
106
|
+
- `Texture.resize()`: Resize a texture to specified dimensions.
|
|
107
|
+
- `Texture.set_pos()`: Set the position of a texture.
|
|
108
|
+
- `Input.is_key_pressed()`: Check if a specific key is currently pressed.
|
|
109
|
+
- `Collision.is_colliding()`: Check for collisions between two objects.
|
|
110
|
+
- And many more!
|
|
111
|
+
|
|
112
|
+
## Contributing
|
|
113
|
+
Contributions to MoonFrame are welcome! If you have an idea for a new feature or want to fix a bug, please open an issue or submit a pull request on GitHub.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
MoonFrame is licensed under the MIT License. See the LICENSE file for more details.
|
|
117
|
+
|
|
118
|
+
## Version History
|
|
119
|
+
- **1.0.0** - Initial release with basic window management, rendering, and input handling.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyglet
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
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="moonframe-engine",
|
|
8
|
+
version="1.0.0",
|
|
9
|
+
author="Samin",
|
|
10
|
+
description="A lightweight 2D game engine built on Pyglet",
|
|
11
|
+
long_description=long_description,
|
|
12
|
+
long_description_content_type="text/markdown", # This clears the warning
|
|
13
|
+
url="https://github.com/YourUsername/MoonFrame", # Link to your repo
|
|
14
|
+
packages=find_packages(),
|
|
15
|
+
install_requires=[
|
|
16
|
+
"pyglet",
|
|
17
|
+
],
|
|
18
|
+
classifiers=[
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
],
|
|
23
|
+
python_requires='>=3.7',
|
|
24
|
+
)
|