PyScene 1.0.2__tar.gz → 1.0.4__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.0.2 → pyscene-1.0.4}/PKG-INFO +1 -1
- {pyscene-1.0.2 → pyscene-1.0.4}/pyproject.toml +1 -1
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/Game.py +2 -2
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/__init__.py +1 -1
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/objs/GameObj.py +3 -2
- {pyscene-1.0.2 → pyscene-1.0.4}/.gitignore +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/LICENSE +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/README.md +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/Collisions.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/Keys.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/Math.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/Net.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/objs/Collision_shapes.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/objs/Shapes.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/objs/Text.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/objs/__init__.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/objs/animation.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/utils/Assets.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/utils/Subscreen.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/src/PyScene/utils/__init__.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/tests/flappy_bird.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/tests/pause.png +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/tests/test.py +0 -0
- {pyscene-1.0.2 → pyscene-1.0.4}/tests/testColl.py +0 -0
|
@@ -183,7 +183,7 @@ class _game:
|
|
|
183
183
|
if self.active_scene is not None: self.active_scene.destroy()
|
|
184
184
|
self._clear_all_collisions_()
|
|
185
185
|
self.active_scene = self.scenes.get(scene, None)
|
|
186
|
-
if self.active_scene: self.active_scene.
|
|
186
|
+
if self.active_scene: self.active_scene.on_change()
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
class Scene:
|
|
@@ -194,7 +194,7 @@ class Scene:
|
|
|
194
194
|
self._render_queue = []
|
|
195
195
|
self.queue_creation = []
|
|
196
196
|
self.queue_del = []
|
|
197
|
-
Game.
|
|
197
|
+
Game.scenes[name] = self
|
|
198
198
|
|
|
199
199
|
def on_change(self): pass
|
|
200
200
|
|
|
@@ -3,7 +3,7 @@ from ..Math import Vector2D
|
|
|
3
3
|
from ..Game import Game
|
|
4
4
|
|
|
5
5
|
class GameObj: #this will be the base class of every game obj
|
|
6
|
-
def __init__(self, pos, z_index=0, active=True, visible=True):
|
|
6
|
+
def __init__(self, pos, z_index=0, active=True, visible=True, Global=False):
|
|
7
7
|
self.pos: Vector2D = pos
|
|
8
8
|
self.vel: Vector2D = Vector2D(0, 0)
|
|
9
9
|
self.z_index = z_index
|
|
@@ -12,7 +12,8 @@ class GameObj: #this will be the base class of every game obj
|
|
|
12
12
|
self._id = Game._get_id()
|
|
13
13
|
|
|
14
14
|
#add to creation
|
|
15
|
-
Game._queue_add(self)
|
|
15
|
+
if not Global: Game._queue_add(self)
|
|
16
|
+
else: Game.queue_creation.append(self) #if obj is just global anyway
|
|
16
17
|
|
|
17
18
|
def update(self): pass
|
|
18
19
|
def render(self, cam): pass
|
|
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
|