PyScene 1.1.5__tar.gz → 1.1.7__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.
Files changed (30) hide show
  1. {pyscene-1.1.5 → pyscene-1.1.7}/PKG-INFO +2 -2
  2. {pyscene-1.1.5 → pyscene-1.1.7}/README.md +1 -1
  3. {pyscene-1.1.5 → pyscene-1.1.7}/pyproject.toml +1 -1
  4. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/Game.py +3 -0
  5. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/objs/GameObj.py +4 -0
  6. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/objs/Timer.py +0 -1
  7. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/objs/animation.py +1 -1
  8. pyscene-1.1.7/test.py +7 -0
  9. pyscene-1.1.5/test.py +0 -26
  10. {pyscene-1.1.5 → pyscene-1.1.7}/.gitignore +0 -0
  11. {pyscene-1.1.5 → pyscene-1.1.7}/LICENSE +0 -0
  12. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/Collisions.py +0 -0
  13. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/Keys.py +0 -0
  14. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/Math.py +0 -0
  15. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/Net.py +0 -0
  16. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/__init__.py +0 -0
  17. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/__main__.py +0 -0
  18. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/objs/Collision_shapes.py +0 -0
  19. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/objs/Shapes.py +0 -0
  20. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/objs/Text.py +0 -0
  21. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/objs/Tilemap.py +0 -0
  22. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/objs/__init__.py +0 -0
  23. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/tools/manager_gui.py +0 -0
  24. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/utils/Assets.py +0 -0
  25. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/utils/Subscreen.py +0 -0
  26. {pyscene-1.1.5 → pyscene-1.1.7}/src/PyScene/utils/__init__.py +0 -0
  27. {pyscene-1.1.5 → pyscene-1.1.7}/tests/flappy_bird.py +0 -0
  28. {pyscene-1.1.5 → pyscene-1.1.7}/tests/pause.png +0 -0
  29. {pyscene-1.1.5 → pyscene-1.1.7}/tests/testColl.py +0 -0
  30. {pyscene-1.1.5 → pyscene-1.1.7}/tests/tileset.png +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: PyScene
3
- Version: 1.1.5
3
+ Version: 1.1.7
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
@@ -21,7 +21,7 @@ There is also a GUI editor being developed alongside PyScene that can be veiwed
21
21
 
22
22
  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.
23
23
 
24
- PyScene is in developement and API's may change offten, a fully stable version should come with v2.0.0, currently on v1.1.5
24
+ PyScene is in developement and API's may change offten, a fully stable version should come with v2.0.0, currently on v1.1.7
25
25
 
26
26
  Getting Started Basics:
27
27
 
@@ -6,7 +6,7 @@ There is also a GUI editor being developed alongside PyScene that can be veiwed
6
6
 
7
7
  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.
8
8
 
9
- PyScene is in developement and API's may change offten, a fully stable version should come with v2.0.0, currently on v1.1.5
9
+ PyScene is in developement and API's may change offten, a fully stable version should come with v2.0.0, currently on v1.1.7
10
10
 
11
11
  Getting Started Basics:
12
12
 
@@ -3,7 +3,7 @@ requires = ["hatchling >= 1.26"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "PyScene"
6
- version = "1.1.5"
6
+ version = "1.1.7"
7
7
  authors = [
8
8
  { name="Sam Fertig", email="sfertig007@gmail.com" },
9
9
  ]
@@ -86,6 +86,9 @@ class _game:
86
86
  def __update_render_queue(self): #update order of the renders based on z-index
87
87
  self.render_queue = sorted(self.objects, key=lambda obj: obj.z_index)
88
88
 
89
+ def _UpRenQ_(self):
90
+ self.__update_render_queue()
91
+
89
92
  def __handle_queue(self):
90
93
  for obj in self.queue_creation: self.objects.append(obj)
91
94
  for obj in self.queue_del: self.objects.remove(obj)
@@ -26,6 +26,10 @@ class GameObj: #this will be the base class of every game obj
26
26
  obj.parent(self)
27
27
  return obj #QOF
28
28
 
29
+ def set_z_index(self, new_index):
30
+ self.z_index = new_index
31
+ Game._UpRenQ_()
32
+
29
33
  def parent(self, obj):
30
34
  # If we already have a parent, remove ourselves from its list first
31
35
  if self._parent and self in self._parent._children:
@@ -21,7 +21,6 @@ class Timer(GameObj):
21
21
  return self.elapsed
22
22
 
23
23
  def update(self):
24
- if not self.active: return
25
24
  if self.running:
26
25
  self.elapsed += Game.dt
27
26
  if self.elapsed >= self.duration:
@@ -65,7 +65,7 @@ class Animation(GameObj):
65
65
  return self
66
66
 
67
67
  def copy(self):
68
- return Animation(self.image, self.size, self.fps, self.loop, self.pos, self.z_index, self.active, self.visible, self.offset, self._global)
68
+ return Animation(self.image, self.size, self.fps, self.loop, self.pos, self.z_index, self._active, self.visible, self.offset, self._global)
69
69
  def render(self):
70
70
  Game.cam.draw_image(self.get_image(), self.pos, self.offset)
71
71
  def render_to(self, screen):
pyscene-1.1.7/test.py ADDED
@@ -0,0 +1,7 @@
1
+ from src.PyScene import *
2
+
3
+ Game.init(640, 360, "Test - 01", "darkblue", application=True) #init game with width, height, title, background color and application mode
4
+
5
+
6
+ Game.Run(True) #or you can have a manual game loop with Game.Tick or using Game.update and Game.render
7
+ #Also passing true will make the window close if ascape is presed
pyscene-1.1.5/test.py DELETED
@@ -1,26 +0,0 @@
1
- from src.PyScene import *
2
-
3
- Game.init(640, 360, "Test - 01", "darkblue", fullscreen=False)
4
-
5
- class Player(GameObj):
6
- def __init__(self, x, y):
7
- super().__init__(Vector2D(x, y)) #z index is 0 by default
8
- self.rect = self.child(Rect(0, 0, 16, 16, "green")) #if player is destroyed so will the rect
9
-
10
- def update(self):
11
- self.pos += (Keys.get_vector(Keys.a, Keys.d, Keys.w, Keys.s, False)*150)*Game.dt
12
- self.rect.pos = self.pos
13
-
14
- #if Keys.is_pressed(Keys.enter): self.destroy()
15
-
16
- class GameScene(Scene):
17
- def __init__(self):
18
- super().__init__("main")
19
- Player(Game.width/2, Game.height/2) #this will live with scene, if scene changed player will be destroyed
20
-
21
- #Player(200, 200) This would be a global object and live through scene changes
22
-
23
- GameScene() #calling this will create the scene and the super will set it as the current scene
24
-
25
- Game.Run(True) #or you can have a manual game loop with Game.Tick or using Game.update and Game.render
26
- #Also passing true will make the window close if ascape is presed
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