devpace 1.1.0__tar.gz → 1.1.2__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.
- {devpace-1.1.0 → devpace-1.1.2}/PKG-INFO +1 -1
- {devpace-1.1.0 → devpace-1.1.2}/pyproject.toml +1 -1
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/__init__.py +1 -1
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/helpers/_tilemapEditor.py +1 -1
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/helpers/_tilemap_files.py +1 -2
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/helpers/timers.py +9 -1
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/main.py +2 -3
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/physics/dynamicBody.py +16 -1
- {devpace-1.1.0 → devpace-1.1.2}/.gitignore +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/LICENSE +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/README.md +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/GlobalDebugger.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/_net.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/assets/animations.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/assets/cache.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/assets/images.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/assets/text.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/assets/tilemap.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/basics/camera.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/basics/input.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/basics/shapes.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/helpers/utils.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/physics/KinematicPlatform.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/physics/StateManager.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/src/devpace/physics/collisions.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/assets/PL #3 Species(Grass & flowers).png +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/assets/TileSet/PL #1 TileSet(Ground).png +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/assets/TileSet/PL #1 TileSet(Lava Animation).png +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/assets/TileSet/PL #1 TileSet(Water Animation).png +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/assets/levelTiles.png +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/assets/test.png +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/game.json +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/platformergame.py +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/props.json +0 -0
- {devpace-1.1.0 → devpace-1.1.2}/tests/test.json +0 -0
|
@@ -24,7 +24,7 @@ class _TileMapEditor:
|
|
|
24
24
|
self.mode = "painting"
|
|
25
25
|
self.cooldown = False
|
|
26
26
|
|
|
27
|
-
self.cam = Camera(-width/2, -height/2)
|
|
27
|
+
self.cam = Camera(pin[0]-width/2, pin[1]-height/2) #center cam around pin
|
|
28
28
|
self.cam_speed = 275
|
|
29
29
|
|
|
30
30
|
self.win = pygame.Window("Tilemap Editor", (width, height), (x, y))
|
|
@@ -94,8 +94,7 @@ def gen_collision_shapes(self, COL_FULL, COL_HALF_TOP, COL_HALF_BOTTOM, COL_HALF
|
|
|
94
94
|
# CORRECTION: Make sure generated rectangles are actually added to your active collisions list
|
|
95
95
|
for i in _tiles:
|
|
96
96
|
self.collisions.append(i)
|
|
97
|
-
|
|
98
|
-
#print(len(Global.collisions))
|
|
97
|
+
|
|
99
98
|
|
|
100
99
|
def _gen_tiles_left_right(_tiles: list[CollisionRect], used: list, _pos_list: list[tuple], self, SEARCH_TIME: int, shape: CollisionRect):
|
|
101
100
|
used.clear()
|
|
@@ -34,4 +34,12 @@ class Timer:
|
|
|
34
34
|
self.active = False
|
|
35
35
|
|
|
36
36
|
def is_done(self):
|
|
37
|
-
return not self.active
|
|
37
|
+
return not self.active
|
|
38
|
+
|
|
39
|
+
def reset(self, new_time = None):
|
|
40
|
+
if new_time is None:
|
|
41
|
+
self.time_elapsed = 0.0
|
|
42
|
+
else:
|
|
43
|
+
self.time_elapsed = new_time
|
|
44
|
+
|
|
45
|
+
self.active = True
|
|
@@ -21,7 +21,6 @@ class Engine:
|
|
|
21
21
|
pygame.display.set_caption(title)
|
|
22
22
|
|
|
23
23
|
if EXPERIMENTAL_DEBUG:
|
|
24
|
-
print("Starting GlobalDebugger...")
|
|
25
24
|
self.log_queue = multiprocessing.Queue()
|
|
26
25
|
self.debug_prossess = multiprocessing.Process(target=GlobalDebugger, args=(self.log_queue,)).start()
|
|
27
26
|
|
|
@@ -129,10 +128,10 @@ class Engine:
|
|
|
129
128
|
|
|
130
129
|
def remove_obj(self, obj):
|
|
131
130
|
if obj.layer in Global.objects:
|
|
132
|
-
Global.objects[obj.layer]
|
|
131
|
+
if obj in Global.objects[obj.layer]:
|
|
132
|
+
Global.objects[obj.layer].remove(obj)
|
|
133
133
|
|
|
134
134
|
def _func_get_global_(self) -> _global_:
|
|
135
|
-
print("<Engine> Global accsesed")
|
|
136
135
|
return Global
|
|
137
136
|
|
|
138
137
|
def get_current_fps(self):
|
|
@@ -3,11 +3,13 @@ from .._net import Global
|
|
|
3
3
|
from ..helpers.utils import change_layer
|
|
4
4
|
from .collisions import CollisionRect
|
|
5
5
|
class DynamicBody:
|
|
6
|
-
def __init__(self, x, y, width, height, vx=0.0, vy=0.0, show=True, layer=3, gravity=0.0, smartCollisions=True, smartCollisionDist=1):
|
|
6
|
+
def __init__(self, x, y, width, height, vx=0.0, vy=0.0, max_vx=None, max_vy=None, show=True, layer=3, gravity=0.0, smartCollisions=True, smartCollisionDist=1):
|
|
7
7
|
self.x = x
|
|
8
8
|
self.y = y
|
|
9
9
|
self.vx = vx
|
|
10
10
|
self.vy = vy
|
|
11
|
+
self.max_vx = max_vx
|
|
12
|
+
self.max_vy = max_vy
|
|
11
13
|
self.width = width
|
|
12
14
|
self.height = height
|
|
13
15
|
self.show = show
|
|
@@ -50,6 +52,19 @@ class DynamicBody:
|
|
|
50
52
|
self.is_on_right = False
|
|
51
53
|
self.is_on_wall = False
|
|
52
54
|
|
|
55
|
+
#clamps
|
|
56
|
+
if self.max_vx != None:
|
|
57
|
+
if self.vx > self.max_vx:
|
|
58
|
+
self.vx = self.max_vx
|
|
59
|
+
elif self.vx < -self.max_vx:
|
|
60
|
+
self.vx = -self.max_vx
|
|
61
|
+
|
|
62
|
+
if self.max_vy != None:
|
|
63
|
+
if self.vy > self.max_vy:
|
|
64
|
+
self.vy = self.max_vy
|
|
65
|
+
elif self.vy < -self.max_vy:
|
|
66
|
+
self.vy = -self.max_vy
|
|
67
|
+
|
|
53
68
|
#x movement
|
|
54
69
|
self.x+=self.vx*Global.dt
|
|
55
70
|
#if collisions, back up
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|