GameBox 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl
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.
- GameBox/basics/_shapes.py +13 -5
- GameBox/player/_player.py +1 -1
- GameBox/player/_playerPhysics.py +2 -3
- {gamebox-0.1.0.dist-info → gamebox-0.1.2.dist-info}/METADATA +1 -1
- {gamebox-0.1.0.dist-info → gamebox-0.1.2.dist-info}/RECORD +7 -7
- {gamebox-0.1.0.dist-info → gamebox-0.1.2.dist-info}/WHEEL +0 -0
- {gamebox-0.1.0.dist-info → gamebox-0.1.2.dist-info}/licenses/LICENSE +0 -0
GameBox/basics/_shapes.py
CHANGED
|
@@ -12,12 +12,20 @@ class Rect:
|
|
|
12
12
|
self.collision = collision
|
|
13
13
|
|
|
14
14
|
def update(self):
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
if (Global.cam.follow) != (self):
|
|
16
|
+
x = self.x - Global.cam.x
|
|
17
|
+
y = self.y - Global.cam.y
|
|
18
|
+
elif (Global.cam.follow) == (self):
|
|
19
|
+
x = self.x
|
|
20
|
+
y = self.y
|
|
21
|
+
|
|
22
|
+
rect = pygame.Rect(x, y, self.width, self.height)
|
|
18
23
|
if self.collision: Global.collisions.append(rect)
|
|
19
24
|
pygame.draw.rect(Global.screen, self.color, rect)
|
|
20
25
|
|
|
21
26
|
def move(self, x, y):
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
if (Global.cam.follow) != (self):
|
|
28
|
+
self.x += x
|
|
29
|
+
self.y += y
|
|
30
|
+
else:
|
|
31
|
+
Global.cam.move(x, y)
|
GameBox/player/_player.py
CHANGED
|
@@ -25,7 +25,7 @@ class Player:
|
|
|
25
25
|
self.physics.update()
|
|
26
26
|
#debug rect
|
|
27
27
|
rect = pygame.Rect(self.x, self.y, self.dim[0], self.dim[1])
|
|
28
|
-
pygame.draw.rect(Global.screen,
|
|
28
|
+
pygame.draw.rect(Global.screen, self.color, rect)
|
|
29
29
|
|
|
30
30
|
#movement
|
|
31
31
|
def top_down_movement(self):
|
GameBox/player/_playerPhysics.py
CHANGED
|
@@ -22,12 +22,11 @@ class _playerPhysics:
|
|
|
22
22
|
|
|
23
23
|
def update(self):
|
|
24
24
|
self.ckeck_is_on_ground()
|
|
25
|
-
self.fixVelocities()
|
|
26
25
|
x, y = self.check_collisions()
|
|
27
|
-
if
|
|
26
|
+
if (Global.cam.follow) != (self.player):
|
|
28
27
|
self.player.x = x
|
|
29
28
|
self.player.y = y
|
|
30
|
-
elif
|
|
29
|
+
elif (Global.cam.follow) == (self.player):
|
|
31
30
|
dx = -(self.player.x - x)
|
|
32
31
|
dy = -(self.player.y - y)
|
|
33
32
|
Global.cam.move(self.vx, self.vy)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: GameBox
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: GameBox is a beginner-friendly Python package built on top of pygame, designed to make 2D game development faster and easier. It provides ready-to-use modules, utilities, and abstractions that let new developers create polished games without needing advanced coding knowledge—while still offering the flexibility for experienced coders to customize and extend.
|
|
5
5
|
Author-email: Sam Fertig <sfertig007@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -2,13 +2,13 @@ GameBox/__init__.py,sha256=ZGp_MWKpBN5yyxOqNg2XamrccMDJtsg9eLoejEYe72E,625
|
|
|
2
2
|
GameBox/_game.py,sha256=CB8GzTAheE-UvF4-emRsKZm3kmSC-gkpSn46K8D6Vqc,1222
|
|
3
3
|
GameBox/basics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
GameBox/basics/_net.py,sha256=Mdxa8-V3Xm0Gvhb-2lkGj3DfhM0MnREI_nLsccR14xc,658
|
|
5
|
-
GameBox/basics/_shapes.py,sha256=
|
|
5
|
+
GameBox/basics/_shapes.py,sha256=uMcZJNx2ouoX2wrWH9oOEl6pAo38Z9K3wnJlRxc9Ljk,949
|
|
6
6
|
GameBox/basics/cammera.py,sha256=r5veuC6T3PUHM_9O-d-kjsNEDQv0k5-8_AKke2XGn0E,728
|
|
7
7
|
GameBox/basics/utils.py,sha256=w6H34MhxcNoX58iQtlvbT5-4GXefy3RIMTxZGP9fSxA,432
|
|
8
|
-
GameBox/player/_player.py,sha256=
|
|
8
|
+
GameBox/player/_player.py,sha256=usljs6q3pQcJu_ZK6xIohZDxnNSGeMADNv2GRuuxmVQ,1069
|
|
9
9
|
GameBox/player/_playerControler.py,sha256=XEb87RFlgLFoXnXqxIS4lpzHN0wywMNCX5y-NIhw0cs,1715
|
|
10
|
-
GameBox/player/_playerPhysics.py,sha256=
|
|
11
|
-
gamebox-0.1.
|
|
12
|
-
gamebox-0.1.
|
|
13
|
-
gamebox-0.1.
|
|
14
|
-
gamebox-0.1.
|
|
10
|
+
GameBox/player/_playerPhysics.py,sha256=cInqQPTiTkJw6vPcRnb-CyOufquzb1RtnTczWXyAURc,3639
|
|
11
|
+
gamebox-0.1.2.dist-info/METADATA,sha256=kInczaK_uVb9qWKQw85qkHShqM9b7JBat28FUojrE2M,1015
|
|
12
|
+
gamebox-0.1.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
gamebox-0.1.2.dist-info/licenses/LICENSE,sha256=gcuuhKKc5-dwvyvHsXjlC9oM6N5gZ6umYbC8ewW1Yvg,35821
|
|
14
|
+
gamebox-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|