PyScene 1.1.2__tar.gz → 1.1.3__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.
- {pyscene-1.1.2 → pyscene-1.1.3}/PKG-INFO +9 -2
- {pyscene-1.1.2 → pyscene-1.1.3}/README.md +8 -1
- {pyscene-1.1.2 → pyscene-1.1.3}/pyproject.toml +1 -1
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/Game.py +14 -1
- pyscene-1.1.3/src/PyScene/objs/GameObj.py +45 -0
- pyscene-1.1.2/src/PyScene/objs/GameObj.py +0 -24
- {pyscene-1.1.2 → pyscene-1.1.3}/.gitignore +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/LICENSE +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/Collisions.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/Keys.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/Math.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/Net.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/__init__.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/__main__.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/objs/Collision_shapes.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/objs/Shapes.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/objs/Text.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/objs/Tilemap.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/objs/Timer.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/objs/__init__.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/objs/animation.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/tools/manager_gui.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/utils/Assets.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/utils/Subscreen.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/src/PyScene/utils/__init__.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/test.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/tests/flappy_bird.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/tests/pause.png +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/tests/testColl.py +0 -0
- {pyscene-1.1.2 → pyscene-1.1.3}/tests/tileset.png +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: PyScene
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.3
|
|
4
4
|
Summary: A python and pygame Game Engine
|
|
5
5
|
Project-URL: Homepage, https://github.com/sfertig/PyScene
|
|
6
6
|
Project-URL: Issues, https://github.com/sfertig/PyScene/issues
|
|
@@ -19,5 +19,12 @@ This is not a pygame wrapper, as it goed beyons the basic helper features and di
|
|
|
19
19
|
|
|
20
20
|
Please Note: This engine is still in development and many features, like tilemaps and audio, are a work in progress. It also lack any form of documentation, I ask for patience as docs will be rolled out once the core features are more solidified.
|
|
21
21
|
|
|
22
|
-
PyScene is in developement and API's may change offten, a fully stable version should come with v2.0.0, currently on v1.1.
|
|
22
|
+
PyScene is in developement and API's may change offten, a fully stable version should come with v2.0.0, currently on v1.1.3
|
|
23
23
|
|
|
24
|
+
Getting Started Basics:
|
|
25
|
+
|
|
26
|
+
1. Use Game.init(...)
|
|
27
|
+
2. Create custom Game Objects by inheriting GameObj
|
|
28
|
+
3. Create a Scene by inheriting Scene
|
|
29
|
+
4. Use Game.Run(...) #pass in True to have escape close the window
|
|
30
|
+
Not: remenber to use super().__init__(...) is any inherited scene or Game object
|
|
@@ -5,5 +5,12 @@ This is not a pygame wrapper, as it goed beyons the basic helper features and di
|
|
|
5
5
|
|
|
6
6
|
Please Note: This engine is still in development and many features, like tilemaps and audio, are a work in progress. It also lack any form of documentation, I ask for patience as docs will be rolled out once the core features are more solidified.
|
|
7
7
|
|
|
8
|
-
PyScene is in developement and API's may change offten, a fully stable version should come with v2.0.0, currently on v1.1.
|
|
8
|
+
PyScene is in developement and API's may change offten, a fully stable version should come with v2.0.0, currently on v1.1.3
|
|
9
9
|
|
|
10
|
+
Getting Started Basics:
|
|
11
|
+
|
|
12
|
+
1. Use Game.init(...)
|
|
13
|
+
2. Create custom Game Objects by inheriting GameObj
|
|
14
|
+
3. Create a Scene by inheriting Scene
|
|
15
|
+
4. Use Game.Run(...) #pass in True to have escape close the window
|
|
16
|
+
Not: remenber to use super().__init__(...) is any inherited scene or Game object
|
|
@@ -190,7 +190,20 @@ class _game:
|
|
|
190
190
|
self.queue_creation_coll = []
|
|
191
191
|
self.queue_del_coll = []
|
|
192
192
|
self._update_coll = False
|
|
193
|
-
|
|
193
|
+
def clear_global_objs(self):
|
|
194
|
+
self.objects = []
|
|
195
|
+
self.queue_creation = []
|
|
196
|
+
self.queue_del = []
|
|
197
|
+
self.render_queue = []
|
|
198
|
+
def clear_scene_objs(self):
|
|
199
|
+
if self.active_scene is not None:
|
|
200
|
+
self.active_scene._objects = []
|
|
201
|
+
self.active_scene.queue_creation = []
|
|
202
|
+
self.active_scene.queue_del = []
|
|
203
|
+
self.active_scene._render_queue = []
|
|
204
|
+
def clear_all_objs(self):
|
|
205
|
+
self.clear_global_objs()
|
|
206
|
+
self.clear_scene_objs()
|
|
194
207
|
def _set_scene(self, scene=None):
|
|
195
208
|
if self.active_scene is not None: self.active_scene.destroy()
|
|
196
209
|
self._clear_all_collisions_()
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import pygame
|
|
2
|
+
from ..Math import Vector2D
|
|
3
|
+
from ..Game import Game
|
|
4
|
+
|
|
5
|
+
class GameObj: #this will be the base class of every game obj
|
|
6
|
+
def __init__(self, pos=Vector2D(0, 0), z_index=0, active=True, visible=True, Global=False):
|
|
7
|
+
self.pos: Vector2D = pos
|
|
8
|
+
self.vel: Vector2D = Vector2D(0, 0)
|
|
9
|
+
self.z_index = z_index
|
|
10
|
+
self.active = active
|
|
11
|
+
self.visible = visible
|
|
12
|
+
self._id = Game._get_id()
|
|
13
|
+
|
|
14
|
+
self.__parent: GameObj = None
|
|
15
|
+
self.__children: list[GameObj] = []
|
|
16
|
+
|
|
17
|
+
#add to creation
|
|
18
|
+
if Game.always_global: Global = True
|
|
19
|
+
if not Global: Game._queue_add(self)
|
|
20
|
+
else: Game.queue_creation.append(self) #if obj is just global anyway
|
|
21
|
+
|
|
22
|
+
self._global = Global
|
|
23
|
+
|
|
24
|
+
def child(self, obj): #obj is a game object
|
|
25
|
+
self.__children.append(obj)
|
|
26
|
+
obj.parent(self)
|
|
27
|
+
|
|
28
|
+
def parent(self, obj):
|
|
29
|
+
# If we already have a parent, remove ourselves from its list first
|
|
30
|
+
if self.__parent and self in self.__parent.__children:
|
|
31
|
+
self.__parent.__children.remove(self)
|
|
32
|
+
self.__parent = obj
|
|
33
|
+
|
|
34
|
+
def update(self): pass
|
|
35
|
+
def render(self): pass
|
|
36
|
+
def destroy(self):
|
|
37
|
+
Game._queue_remove(self)
|
|
38
|
+
for i in self.__children:
|
|
39
|
+
i.destroy()
|
|
40
|
+
|
|
41
|
+
if self.__parent: self.__parent.__children.remove(self)
|
|
42
|
+
|
|
43
|
+
self.__children = []
|
|
44
|
+
self.__parent = None
|
|
45
|
+
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import pygame
|
|
2
|
-
from ..Math import Vector2D
|
|
3
|
-
from ..Game import Game
|
|
4
|
-
|
|
5
|
-
class GameObj: #this will be the base class of every game obj
|
|
6
|
-
def __init__(self, pos=Vector2D(0, 0), z_index=0, active=True, visible=True, Global=False):
|
|
7
|
-
self.pos: Vector2D = pos
|
|
8
|
-
self.vel: Vector2D = Vector2D(0, 0)
|
|
9
|
-
self.z_index = z_index
|
|
10
|
-
self.active = active
|
|
11
|
-
self.visible = visible
|
|
12
|
-
self._id = Game._get_id()
|
|
13
|
-
|
|
14
|
-
#add to creation
|
|
15
|
-
if Game.always_global: Global = True
|
|
16
|
-
if not Global: Game._queue_add(self)
|
|
17
|
-
else: Game.queue_creation.append(self) #if obj is just global anyway
|
|
18
|
-
|
|
19
|
-
self._global = Global
|
|
20
|
-
|
|
21
|
-
def update(self): pass
|
|
22
|
-
def render(self): pass
|
|
23
|
-
def destroy(self): Game._queue_remove(self)
|
|
24
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|