GameBox 0.3.0__tar.gz → 0.9.0__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 (34) hide show
  1. {gamebox-0.3.0 → gamebox-0.9.0}/PKG-INFO +1 -1
  2. {gamebox-0.3.0 → gamebox-0.9.0}/pyproject.toml +1 -1
  3. gamebox-0.9.0/src/GameBox/GameLevel_ui/_Animations.py +39 -0
  4. gamebox-0.9.0/src/GameBox/GameLevel_ui/_sprites.py +243 -0
  5. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/__init__.py +10 -0
  6. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/_game.py +6 -0
  7. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/basics/_net.py +2 -0
  8. gamebox-0.9.0/src/GameBox/basics/_shapes.py +88 -0
  9. gamebox-0.9.0/src/GameBox/basics/cammera.py +75 -0
  10. gamebox-0.9.0/src/GameBox/helpers/_Conditions.py +65 -0
  11. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/helpers/_collisions.py +13 -12
  12. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/helpers/_input.py +4 -0
  13. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/player/_player.py +32 -6
  14. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/player/_playerPhysics.py +2 -2
  15. gamebox-0.9.0/src/GameBox/player/_playerSprite.py +86 -0
  16. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/tilemap/_tilemap.py +14 -0
  17. gamebox-0.9.0/src/GameBox/ui/_basicUI.py +65 -0
  18. gamebox-0.9.0/tests/GettingStarted.py +52 -0
  19. gamebox-0.9.0/tests/Player.png +0 -0
  20. {gamebox-0.3.0 → gamebox-0.9.0}/tests/basicScreen.py +3 -2
  21. gamebox-0.9.0/tests/testMap.json +1 -0
  22. gamebox-0.3.0/src/GameBox/basics/_shapes.py +0 -33
  23. gamebox-0.3.0/src/GameBox/basics/cammera.py +0 -36
  24. gamebox-0.3.0/tests/testMap.json +0 -1
  25. {gamebox-0.3.0 → gamebox-0.9.0}/.gitignore +0 -0
  26. {gamebox-0.3.0 → gamebox-0.9.0}/LICENSE +0 -0
  27. {gamebox-0.3.0 → gamebox-0.9.0}/README.md +0 -0
  28. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/basics/__init__.py +0 -0
  29. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/basics/utils.py +0 -0
  30. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/player/_playerControler.py +0 -0
  31. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/tilemap/_Editor.py +0 -0
  32. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/tilemap/_collisionDef.py +0 -0
  33. {gamebox-0.3.0 → gamebox-0.9.0}/src/GameBox/tilemap/_editorBrushes.py +0 -0
  34. {gamebox-0.3.0 → gamebox-0.9.0}/tests/levelTiles.png +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameBox
3
- Version: 0.3.0
3
+ Version: 0.9.0
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
@@ -3,7 +3,7 @@ requires = ["hatchling >= 1.26"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "GameBox"
6
- version = "0.3.0"
6
+ version = "0.9.0"
7
7
  authors = [
8
8
  { name="Sam Fertig", email="sfertig007@gmail.com" },
9
9
  ]
@@ -0,0 +1,39 @@
1
+ import pygame
2
+ import numpy as np
3
+
4
+ from ..basics._net import Global
5
+
6
+ class Animation:
7
+ def __init__(self, image, tileDim, startPos, frames, dur):
8
+ if type(image) == str:
9
+ image = pygame.image.load(image)
10
+
11
+ #others
12
+ self.dur = dur
13
+ self.currentFrame = 0
14
+ self.currentDur = 0
15
+
16
+ #get frames from image
17
+ self.frames = []
18
+ x, y = startPos
19
+ x *= tileDim[0]
20
+ y *= tileDim[1]
21
+ for i in range(frames):
22
+ self.frames.append(image.subsurface(x, y, tileDim[0], tileDim[1]))
23
+ x += tileDim[0]
24
+ if x >= image.get_width():
25
+ x = 0
26
+ y += tileDim[1]
27
+
28
+ def update(self, dt):
29
+ self.currentDur += dt
30
+ if self.currentDur >= self.dur:
31
+ self.currentDur = 0
32
+ self.currentFrame += 1
33
+ if self.currentFrame >= len(self.frames):
34
+ self.currentFrame = 0
35
+
36
+ def getFrame(self):
37
+ return self.frames[self.currentFrame]
38
+
39
+
@@ -0,0 +1,243 @@
1
+ import pygame
2
+ import numpy as np
3
+
4
+ from ..basics._net import Global
5
+ from ._Animations import Animation
6
+
7
+ class Sprite_2d:
8
+ def __init__(self, pos: tuple, image, scale: float = 1.0, collision = True, dirrection: int = 1):
9
+ """
10
+ Initialize a 2D sprite.
11
+
12
+ Args:
13
+ pos: Tuple (x, y) for the sprite position
14
+ image: Either a file path (str) or pygame.Surface object
15
+ scale: Scale factor for the sprite (default: 1.0)
16
+ """
17
+ #add to game
18
+ Global.game.objs.append(self)
19
+ self.collision = collision
20
+ self.__worldPos__ = True
21
+ self.dir = dirrection
22
+
23
+ self.pos = pos
24
+ if type(image) == str:
25
+ self.image = pygame.image.load(image)
26
+ else:
27
+ self.image = image
28
+
29
+ #scale image
30
+ print(self.image)
31
+ self.image = pygame.transform.scale_by(self.image, scale)
32
+ #flip image
33
+ if self.dir == -1:
34
+ self.image = pygame.transform.flip(self.image, True, False)
35
+
36
+ def update(self):
37
+ #world space
38
+ x, y = self.pos
39
+ if self.__worldPos__:
40
+ x = x - Global.cam.x
41
+ y = y - Global.cam.y
42
+ Global.screen.blit(self.image, (x, y))
43
+ if self.collision:
44
+ rect = self.image.get_rect()
45
+ rect.x = x
46
+ rect.y = y
47
+ Global.collisions.append(rect)
48
+
49
+ def switch_dirrection(self):
50
+ self.image = pygame.transform.flip(self.image, True, False)
51
+
52
+
53
+ def move_by(self, x: int, y: int):
54
+ self.pos = (self.pos[0] + x, self.pos[1] + y)
55
+
56
+ def move_to(self, x: int, y: int):
57
+ self.pos = (x, y)
58
+
59
+ def get_pos(self):
60
+ return self.pos
61
+
62
+ def rescale(self, scale: float):
63
+ self.image = pygame.transform.scale_by(self.image, scale)
64
+
65
+ def __remove__(self):
66
+ Global.game.objs.remove(self)
67
+
68
+ def split_image(image, tileDim, startPos):
69
+ if type(image) == str:
70
+ image = pygame.image.load(image)
71
+ else:
72
+ image = image
73
+
74
+ #return image split
75
+ x = startPos[0] * tileDim[0]
76
+ y = startPos[1] * tileDim[1]
77
+ return image.subsurface((x, y, tileDim[0], tileDim[1]))
78
+
79
+ class Animated_Sprite2D:
80
+ """
81
+ A class for animated 2D sprites.
82
+
83
+ Args:
84
+ pos (tuple): The position of the sprite in world space.
85
+ image (str or pygame.Surface): The image of the sprite.
86
+ imageDim (tuple): The dimensions of the image.
87
+ tileDim (tuple): The dimensions of the tiles in the image.
88
+ frames (int): The number of frames in the animation.
89
+ speed (float): The speed of the animation.
90
+ scale (float): The scale of the sprite.
91
+ collision (bool): Whether the sprite has collision.
92
+ dirrection (int): The direction of the sprite.
93
+
94
+ Attributes:
95
+ animation (Animation): The animation of the sprite.
96
+ collision (bool): Whether the sprite has collision.
97
+ dir (int): The direction of the sprite.
98
+ pos (tuple): The position of the sprite in world space.
99
+ scale (float): The scale of the sprite.
100
+ image (pygame.Surface): The current frame of the animation.
101
+ __worldPos__ (bool): Whether the sprite is in world space.
102
+
103
+ Methods:
104
+ update (None): Updates the sprite.
105
+ __remove__ (None): Removes the sprite from the game.
106
+ switch_dirrection (None): Switches the direction of the sprite.
107
+ move_by (x, y): Moves the sprite by (x, y) in world space.
108
+ move_to (x, y): Moves the sprite to (x, y) in world space.
109
+ get_pos (None): Returns the position of the sprite in world space.
110
+ rescale (scale): Rescales the sprite by the given scale.
111
+ """
112
+
113
+ def __init__(self, pos, image, imageDim, tileDim, frames, speed, scale = 1.0, collision = True, dirrection = 1):
114
+ """
115
+
116
+ """
117
+
118
+ self.animation = Animation(image, tileDim, (0, 0), frames, speed)
119
+ self.collision = collision
120
+ self.dir = dirrection
121
+ self.pos = pos
122
+
123
+ self.scale = scale
124
+ self.image = pygame.transform.scale_by(self.animation.getFrame(), scale)
125
+ if self.dir == -1:
126
+ self.image = pygame.transform.flip(self.image, True, False)
127
+
128
+ self.__worldPos__ = True
129
+
130
+ #add to game
131
+ Global.game.objs.append(self)
132
+
133
+ def update(self):
134
+ self.animation.update(Global.dt)
135
+ self.image = pygame.transform.scale_by(self.animation.getFrame(), self.scale)
136
+ if self.dir == -1:
137
+ self.image = pygame.transform.flip(self.image, True, False)
138
+
139
+ #world space
140
+ x, y = self.pos
141
+ if self.__worldPos__:
142
+ x = x - Global.cam.x
143
+ y = y - Global.cam.y
144
+ Global.screen.blit(self.image, (x, y))
145
+ if self.collision:
146
+ rect = self.image.get_rect()
147
+ rect.x = x
148
+ rect.y = y
149
+ Global.collisions.append(rect)
150
+
151
+ def __remove__(self):
152
+ Global.game.objs.remove(self)
153
+
154
+ def switch_dirrection(self):
155
+ self.image = pygame.transform.flip(self.image, True, False)
156
+
157
+ def move_by(self, x: int, y: int):
158
+ self.pos = (self.pos[0] + x, self.pos[1] + y)
159
+
160
+ def move_to(self, x: int, y: int):
161
+ self.pos = (x, y)
162
+
163
+ def get_pos(self):
164
+ return self.pos
165
+
166
+ def rescale(self, scale: float):
167
+ self.image = pygame.transform.scale_by(self.image, scale)
168
+
169
+ class AnimationPlayer2D:
170
+ """
171
+ Class for playing animations in a 2D game.
172
+
173
+ Attributes:
174
+ pos (tuple): Position of the AnimationPlayer2D.
175
+ scale (float): Scale of the AnimationPlayer2D.
176
+ anims (dict): Dictionary of animations that can be played, where the key is the name of the animation and the value is an instance of Animated_Sprite2D.
177
+ currentAnim (str): The name of the currently playing animation.
178
+
179
+ Methods:
180
+ update (None): Updates the currently playing animation.
181
+ add_animation (name, image, imageDim, tileDim, frames, speed, scale = 1.0, collision = True, dirrection = 1): Adds an animation to the AnimationPlayer2D.
182
+ remove_animation (name: str): Removes an animation from the AnimationPlayer2D.
183
+ set_worldPos (worldPos: bool): Sets the world position of all animations in the AnimationPlayer2D.
184
+ __remove__ (None): Removes the AnimationPlayer2D from the game.
185
+ set_scale (scale: float): Sets the scale of all animations in the AnimationPlayer2D.
186
+ set_animation (anim: str): Sets the currently playing animation.
187
+ move_by (x, y): Moves the AnimationPlayer2D by (x, y) in world space.
188
+ move_to (x, y): Moves the AnimationPlayer2D to (x, y) in world space.
189
+ get_pos (None): Returns the position of the AnimationPlayer2D in world space.
190
+ """
191
+ def __init__(self, pos, scale):
192
+ self.pos = pos
193
+ self.scale = scale
194
+ self.anims = {}
195
+ self.currentAnim = None
196
+
197
+ self.__worldPos__ = True
198
+
199
+ #add to game
200
+ Global.game.objs.append(self)
201
+
202
+ def update(self):
203
+ if self.currentAnim is not None:
204
+ self.anims[self.currentAnim].update()
205
+
206
+ def add_animation(self, name, image, imageDim, tileDim, frames, speed, scale = 1.0, collision = True, dirrection = 1):
207
+ self.anims[name] = Animated_Sprite2D(self.pos, image, imageDim, tileDim, frames, speed, scale, collision, dirrection)
208
+ self.currentAnim = name
209
+ self.anims[self.currentAnim].__remove__()
210
+
211
+ def remove_animation(self, name: str):
212
+ self.anims[name].__remove__()
213
+ del self.anims[name]
214
+
215
+ def set_worldPos(self, worldPos: bool):
216
+ for anim in self.anims:
217
+ self.anims[anim].__worldPos__ = worldPos
218
+
219
+ def __remove__(self):
220
+ if self in Global.game.objs:
221
+ Global.game.objs.remove(self)
222
+
223
+ def set_scale(self, scale: float):
224
+ for anim in self.anims:
225
+ self.anims[anim].rescale(scale)
226
+
227
+ def set_animation(self, anim: str):
228
+ self.currentAnim = anim
229
+
230
+ def move_by(self, x: int, y: int):
231
+ self.pos = (self.pos[0] + x, self.pos[1] + y)
232
+ for anim in self.anims:
233
+ self.anims[anim].move_by(x, y)
234
+
235
+ def move_to(self, x: int, y: int):
236
+ self.pos = (x, y)
237
+ for anim in self.anims:
238
+ self.anims[anim].move_to(x, y)
239
+
240
+ def get_pos(self):
241
+ return self.pos
242
+
243
+
@@ -16,6 +16,10 @@ from .player._player import Player
16
16
  from .basics.utils import clamp, moveTward, zeroOut
17
17
  from .tilemap._tilemap import TileMap
18
18
  from.helpers._input import Keys
19
+ from .ui._basicUI import Image
20
+
21
+ from .GameLevel_ui._sprites import Sprite_2d, Animated_Sprite2D, AnimationPlayer2D, split_image
22
+ from.helpers._Conditions import Conditions
19
23
 
20
24
 
21
25
  __all__ = [
@@ -28,5 +32,11 @@ __all__ = [
28
32
  "zeroOut",
29
33
  "TileMap",
30
34
  "Keys",
35
+ "Image",
36
+ "Sprite_2d",
37
+ "Animated_Sprite2D",
38
+ "AnimationPlayer2D",
39
+ "split_image",
40
+ "Conditions",
31
41
  ]
32
42
 
@@ -26,6 +26,7 @@ class Game:
26
26
  Global.clock = pygame.time.Clock()
27
27
  Global.game = self
28
28
  self.objs = []
29
+ self.ui_objs = []
29
30
 
30
31
 
31
32
  def update(self, event: pygame.event,frame_rate=60):
@@ -40,6 +41,11 @@ class Game:
40
41
  if type(obj) == Player: player = obj
41
42
  else: obj.update()
42
43
  if player != None: player.update()
44
+
45
+ #update ui
46
+ for obj in self.ui_objs:
47
+ obj.update()
48
+
43
49
  pygame.display.update()
44
50
 
45
51
  def get_screen(self):
@@ -18,6 +18,8 @@ class _global_:
18
18
  #-collisions
19
19
  self.collisions: list[pygame.Rect] = []
20
20
 
21
+ self.cond: object = None
22
+
21
23
  #objects
22
24
  self.player = self._player()
23
25
  self.tilemap = []
@@ -0,0 +1,88 @@
1
+ import pygame
2
+ import numpy as np
3
+
4
+ from ..basics._net import Global
5
+
6
+ class Rect:
7
+ """
8
+ A rectangle shape used for rendering and collision detection.
9
+
10
+ Args:
11
+ pos (tuple): The position of the rectangle.
12
+ size (tuple): The size of the rectangle.
13
+ color (tuple, optional): The color of the rectangle. Defaults to (0,0,0).
14
+ collision (bool, optional): Whether the rectangle should be used for collision detection. Defaults to True.
15
+ """
16
+
17
+ def __init__(self, pos: tuple, size: tuple, color: tuple = (0, 0, 0), collision: bool = True):
18
+ """
19
+ Initialize the rectangle object.
20
+
21
+ Args:
22
+ pos (tuple): The position of the rectangle.
23
+ size (tuple): The size of the rectangle.
24
+ color (tuple, optional): The color of the rectangle. Defaults to (0,0,0).
25
+ collision (bool, optional): Whether the rectangle should be used for collision detection. Defaults to True.
26
+ """
27
+ self.x, self.y = pos
28
+ self.width, self.height = size
29
+ self.color = color
30
+ Global.game.objs.append(self)
31
+ self.collision = collision
32
+
33
+ def update(self):
34
+ """
35
+ Update the rectangle object.
36
+
37
+ This method updates the position and size of the rectangle based on the camera's position and scale.
38
+ It then renders the rectangle to the screen and adds it to the collision detection list if necessary.
39
+ """
40
+ width = self.width * Global.cam.scale
41
+ height = self.height * Global.cam.scale
42
+ if (Global.cam.follow) != (self):
43
+ x = self.x - Global.cam.x
44
+ y = self.y - Global.cam.y
45
+ elif (Global.cam.follow) == (self):
46
+ x = self.x
47
+ y = self.y
48
+
49
+ rect = pygame.Rect(x, y, width, height)
50
+ if self.collision: Global.collisions.append(rect)
51
+ pygame.draw.rect(Global.screen, self.color, rect)
52
+
53
+ def move(self, x, y):
54
+ """
55
+ Move the rectangle object.
56
+
57
+ Args:
58
+ x (int): The x-coordinate to move the rectangle by.
59
+ y (int): The y-coordinate to move the rectangle by.
60
+ """
61
+ if (Global.cam.follow) != (self):
62
+ self.x += x
63
+ self.y += y
64
+ else:
65
+ Global.cam._move(x, y)
66
+
67
+ def move_to(self, x, y):
68
+ """
69
+ Move the rectangle object to a specific position.
70
+
71
+ Args:
72
+ x (int): The x-coordinate to move the rectangle to.
73
+ y (int): The y-coordinate to move the rectangle to.
74
+ """
75
+ if (Global.cam.follow) != (self):
76
+ self.x = x
77
+ self.y = y
78
+ else:
79
+ Global.cam.x = x
80
+ Global.cam.y = y
81
+
82
+ def __remove__(self):
83
+ """
84
+ Remove the rectangle object from the game.
85
+
86
+ This method removes the rectangle object from the game's object list.
87
+ """
88
+ Global.game.objs.remove(self)
@@ -0,0 +1,75 @@
1
+ import pygame
2
+ import numpy as np
3
+
4
+ from ._net import Global
5
+
6
+ from ..basics.utils import moveTward
7
+
8
+ class Cammera:
9
+ """
10
+ A class for the camera object.
11
+ """
12
+
13
+ def __init__(self, scale: float = 1.0):
14
+ """
15
+ Initialize the camera object.
16
+
17
+ Args:
18
+ scale (float): The scale of the camera (default: 1.0)
19
+ """
20
+ self.x = 0
21
+ self.y = 0
22
+ Global.game.objs.append(self)
23
+ Global.cam = self
24
+ self.follow = None
25
+ self.diff = (0, 0)
26
+ self.scale = scale
27
+
28
+ def _move(self, x: int, y: int):
29
+ """
30
+ Move the camera by (x, y).
31
+
32
+ Args:
33
+ x (int): The x component of the movement
34
+ y (int): The y component of the movement
35
+ """
36
+ self.x += x
37
+ self.y += y
38
+
39
+ def update(self):
40
+ """
41
+ Update the camera position based on the follow target.
42
+ """
43
+ return
44
+ if self.follow is not None:
45
+ self.x = (self.follow.x - self.diff[0])
46
+ self.y = (self.follow.y - self.diff[1])
47
+
48
+ def set_follow_target(self, target: object):
49
+ """
50
+ Set the follow target for the camera.
51
+
52
+ Args:
53
+ target (object): The object to follow
54
+ """
55
+ self.follow = target
56
+ print(target)
57
+ self.diff = (target.x - self.x, target.y - self.y)
58
+
59
+ def set_scale(self, scale: float = 1.0):
60
+ """
61
+ Set the scale of the camera.
62
+
63
+ Args:
64
+ scale (float): The scale of the camera (default: 1.0)
65
+ """
66
+ self.scale = scale
67
+
68
+ def change_scale(self, scale: float = 1.0):
69
+ """
70
+ Change the scale of the camera by the given amount.
71
+
72
+ Args:
73
+ scale (float): The amount to change the scale by (default: 1.0)
74
+ """
75
+ self.scale += scale
@@ -0,0 +1,65 @@
1
+ import pygame
2
+ import numpy as np
3
+
4
+ from ..basics.utils import zeroOut
5
+ from ..basics._net import Global
6
+
7
+ class _Conditions:
8
+ """
9
+ Class containing the predefined conditions for the game.
10
+ Conditions are in the format of 'C' followed by the command ('v' for velocity), and dir (^ up, _ down, < left, > right, # none, ~ any)
11
+ """
12
+
13
+ def __init__(self):
14
+ """
15
+ Initialize the conditions.
16
+ """
17
+ # conditions start with 'C' and then command ('v' for velocity), and dir (^ up, _ down, < left, > right, # none, ~ any)
18
+ self.velocity_up = 'CV^' # velocity up
19
+ self.velocity_down = 'CV_' # velocity down
20
+ self.velocity_left = 'CV<' # velocity left
21
+ self.velocity_right = 'CV>' # velocity right
22
+ self.velocity_none = 'CV#' # velocity none
23
+ self.velocity_any = 'CV~' # velocity any
24
+
25
+ Conditions = _Conditions()
26
+ Global.cond = Conditions
27
+
28
+ class Condition_check:
29
+ def __init__(self, stateTree: dict[str, dict[_Conditions, str]], currentState: str):
30
+ self.stateTree = stateTree
31
+ self.currentState = currentState
32
+
33
+ def check(self, velocity: tuple, pos: tuple):
34
+ state = self.stateTree[self.currentState]
35
+ for cond, next in state.items():
36
+ #velocities
37
+ if cond[1] == 'V':
38
+ if self._resolve_velocities(velocity, cond):
39
+ self.currentState = next
40
+ return next
41
+ return self.currentState
42
+
43
+
44
+ def _resolve_velocities(self, velocities, cond):
45
+ vx, vy = velocities
46
+ Max = 0.3
47
+ vx = zeroOut(vx, Max)
48
+ vy = zeroOut(vy, Max)
49
+ dir = cond[2]
50
+ print(vx, vy, dir)
51
+ #resolve in order up, down, left, right, none, any
52
+ if dir == "^" and vy < 0: return True
53
+ if dir == "_" and vy > 0: return True
54
+ if dir == "<" and vx < 0: return True
55
+ if dir == ">" and vx > 0: return True
56
+ if dir == "#" and vx == 0 and vy == 0: return True
57
+ if dir == "~" and (vx != 0 or vy != 0): return True
58
+ return False
59
+
60
+ def updateState(self, state: str):
61
+ self.currentState = state
62
+ def updateStateTree(self, stateTree: dict[str, dict[_Conditions, str]]):
63
+ self.stateTree = stateTree
64
+
65
+
@@ -7,7 +7,6 @@ from ..basics._net import Global
7
7
  def CheckCollisions(x, y, vx, vy, dim, sample, obj):
8
8
  x, y = x + vx, y + vy
9
9
 
10
-
11
10
  #basic object collisions
12
11
  x, y, vx, vy = _mainCollisionLogic(Global.collisions, x, y, vx, vy, dim)
13
12
  x, y, vx, vy = _checkTilemapCollisions(x, y, vx, vy, dim, sample, obj)
@@ -15,20 +14,12 @@ def CheckCollisions(x, y, vx, vy, dim, sample, obj):
15
14
  return x, y, vx, vy
16
15
 
17
16
  def _mainCollisionLogic(collisions, x, y, vx, vy, dim):
18
- new_rect = pygame.Rect((x, y), dim)
19
- for collision in collisions:
20
- #pygame.draw.rect(Global.screen, (255, 0, 0), collision, 1)
21
- if collision.colliderect(new_rect):
22
- if vx > 0:
23
- x = collision.left - dim[0]
24
- elif vx < 0:
25
- x = collision.right
26
- vx = 0
27
-
28
17
  # Y-axis collisions
18
+ py = y
29
19
  new_rect = pygame.Rect((x, y), dim)
20
+ pygame.draw.rect(Global.screen, "green", new_rect, 5)
30
21
  for collision in collisions:
31
- #pygame.draw.rect(Global.screen, (255, 0, 0), collision, 1)
22
+ pygame.draw.rect(Global.screen, "yellow", collision, 5)
32
23
  if collision.colliderect(new_rect):
33
24
  if vy > 0: # falling
34
25
  y = collision.top - dim[1]
@@ -36,6 +27,16 @@ def _mainCollisionLogic(collisions, x, y, vx, vy, dim):
36
27
  elif vy < 0: # jumping
37
28
  y = collision.bottom
38
29
  vy = 0
30
+
31
+ new_rect = pygame.Rect((x, py), dim)
32
+ for collision in collisions:
33
+ pygame.draw.rect(Global.screen, "yellow", collision, 5)
34
+ if collision.colliderect(new_rect):
35
+ if vx > 0:
36
+ x = collision.left - dim[0]
37
+ elif vx < 0:
38
+ x = collision.right
39
+ vx = 0
39
40
 
40
41
  return x, y, vx, vy
41
42
 
@@ -4,6 +4,9 @@ from ..basics._net import Global
4
4
 
5
5
 
6
6
  class _keys:
7
+ """
8
+ A class that holds all the key bindings for the game
9
+ """
7
10
  def __init__(self):
8
11
 
9
12
  #alphabet
@@ -61,6 +64,7 @@ class _keys:
61
64
 
62
65
  #mouse
63
66
  self.mouse_x, self.mouse_y = 0, 0
67
+
64
68
  def init(self): Global.game.objs.append(self)
65
69
 
66
70
  def is_pressed(self, key):
@@ -4,37 +4,61 @@ import numpy as np
4
4
  from ..basics._net import Global
5
5
 
6
6
  from ..player._playerPhysics import _playerPhysics
7
+ from ..player._playerSprite import _playerSprite
8
+
9
+ from ..GameLevel_ui._sprites import Sprite_2d
7
10
 
8
11
  class Player:
12
+ """
13
+ Initialize a Player object.
14
+
15
+ Parameters:
16
+ pos (tuple): The position of the Player in world space.
17
+ size (tuple): The size of the Player in world space.
18
+ color (tuple): The color of the Player (default: (0, 0, 0)).
19
+ gravity (bool): Whether the Player is affected by gravity (default: False).
20
+
21
+ Returns:
22
+ None
23
+ """
9
24
  def __init__(self, pos: tuple, size: tuple, color: tuple = (0, 0, 0), gravity: bool = False):
25
+ # Set the position and size of the Player
10
26
  self.x, self.y = pos
11
27
  self.screenPos = pos
12
28
  self.dim = size
13
29
  self.color = color
30
+ self.width, self.height = size
14
31
 
32
+ # Set whether the Player is affected by gravity
15
33
  self.gravity = gravity
16
-
34
+
35
+ # State of the Player (e.g. "jumping", "standing", etc.)
36
+ self.state = ""
37
+
38
+ # Add the Player to the game
17
39
  Global.game.objs.append(self)
18
40
  Global.player.pos = pos
19
41
  Global.player.player = self
20
42
 
43
+ # Initialize the sprite for the Player
44
+ self.sprite = _playerSprite(self)
45
+
21
46
 
22
47
  def add_physics(self, speed: float = 1.0, gravity: float = 0.0, jump: float = 10.0, maxV: float = 10.0, airRes: float = 0.2):
23
48
  self.physics = _playerPhysics(self, speed, gravity, jump, maxV, airRes)
24
49
 
25
50
  def update(self):
26
51
  self.physics.update()
27
- #debug rect
28
- width = self.dim[0] * Global.cam.scale
29
- height = self.dim[1] * Global.cam.scale
52
+ #ui
53
+
30
54
  if (Global.cam.follow) != (self):
31
55
  x = self.x - Global.cam.x
32
56
  y = self.y - Global.cam.y
33
57
  elif (Global.cam.follow) == (self):
34
58
  x = self.x
35
59
  y = self.y
36
- rect = pygame.Rect(x, y, width, height)
37
- pygame.draw.rect(Global.screen, self.color, rect)
60
+ velocity = (self.physics.vx, self.physics.vy)
61
+ self.sprite.update(x, y, velocity)
38
62
 
39
63
  #movement
40
64
  def top_down_movement(self):
@@ -50,3 +74,5 @@ class Player:
50
74
  The larger the sample size the longer it may take to calculate collisions per frame.
51
75
  """
52
76
  self.physics.sample = sample
77
+
78
+
@@ -19,7 +19,7 @@ class _playerPhysics:
19
19
  self.onGround = False
20
20
  self.canJump = False
21
21
 
22
- self.sample = 10
22
+ self.sample = 25
23
23
 
24
24
  self.vx, self.vy = 0, 0
25
25
 
@@ -34,7 +34,7 @@ class _playerPhysics:
34
34
  elif (Global.cam.follow) == (self.player):
35
35
  dx = -(self.player.x - x)
36
36
  dy = -(self.player.y - y)
37
- Global.cam.move(self.vx, self.vy)
37
+ Global.cam._move(self.vx, self.vy)
38
38
 
39
39
 
40
40
 
@@ -0,0 +1,86 @@
1
+ import pygame
2
+ import numpy as np
3
+
4
+ from ..basics._net import Global
5
+
6
+ from ..GameLevel_ui._sprites import Sprite_2d, Animated_Sprite2D, AnimationPlayer2D
7
+ from ..helpers._Conditions import Condition_check, _Conditions
8
+
9
+ class _playerSprite:
10
+ def __init__(self, player):
11
+ self.player = player
12
+
13
+ self.state = player.state
14
+ self.statetree = {}
15
+ self.condition_check = None
16
+
17
+ self.sprite = None
18
+
19
+
20
+ def update(self, x, y, velocity):
21
+ #state updates
22
+ if self.condition_check is not None:
23
+ self.state = self.condition_check.check(velocity, self.player.screenPos)
24
+ #set animation if possible
25
+ if type(self.sprite) == AnimationPlayer2D:
26
+ if self.state in self.sprite.anims:
27
+ self.sprite.set_animation(self.state)
28
+ #any changes to follow target
29
+ if Global.cam.follow == self.player and self.sprite is not None:
30
+ self.sprite.__worldPos__ = False
31
+ self.sprite.move_to(self.player.screenPos[0], self.player.screenPos[1])
32
+ elif Global.cam.follow != self.player and self.sprite is not None:
33
+ self.sprite.__worldPos__ = True
34
+ self.sprite.move_to(self.player.x, self.player.y)
35
+
36
+ if self.sprite is None:
37
+ #rect (x, y) is top left corner
38
+ rect = pygame.Rect((x, y), self.player.dim)
39
+ pygame.draw.rect(Global.screen, self.player.color, rect)
40
+ if type(self.sprite) == Sprite_2d:
41
+ self.sprite.update()
42
+ elif type(self.sprite) == Animated_Sprite2D:
43
+ self.sprite.update()
44
+ elif type(self.sprite) == AnimationPlayer2D:
45
+ self.sprite.update()
46
+
47
+ def add_sprite_2d(self, image, scale=1.0, dirrection=1):
48
+ self.sprite = Sprite_2d((self.player.x, self.player.y), image, scale, False, dirrection)
49
+ if Global.cam.follow == self.player:
50
+ self.sprite.__worldPos__ = False
51
+ self.sprite.__remove__()
52
+
53
+ def add_animated_sprite_2d(self, image, imageDim, tileDim, frames, speed, scale = 1.0, collision = False, dirrection = 1):
54
+ self.sprite = Animated_Sprite2D((self.player.x, self.player.y), image, imageDim, tileDim, frames, speed, scale, collision, dirrection)
55
+ if Global.cam.follow == self.player:
56
+ self.sprite.__worldPos__ = False
57
+ self.sprite.__remove__()
58
+
59
+ def remove_sprite(self):
60
+ if self.sprite is not None:
61
+ self.sprite = None
62
+
63
+ def add_animation_player(self, scale = 1.0):
64
+ self.sprite = AnimationPlayer2D((self.player.x, self.player.y), scale)
65
+ if Global.cam.follow == self.player:
66
+ self.sprite.set_worldPos(False)
67
+ self.sprite.__remove__()
68
+
69
+ def add_animation(self, name, image, imageDim, tileDim, frames, speed, scale = 1.0, collision = True, dirrection = 1):
70
+ self.sprite.add_animation(name, image, imageDim, tileDim, frames, speed, scale, collision, dirrection)
71
+ self.sprite.__remove__()
72
+ self.sprite.set_worldPos(False)
73
+
74
+ def remove_animation(self, name: str):
75
+ self.sprite.remove_animation(name)
76
+
77
+ def set_animation(self, anim: str):
78
+ self.sprite.set_animation(anim)
79
+
80
+ def set_states(self, stateTree: dict[str, dict[_Conditions, str]], currentState: str):
81
+ self.statetree = stateTree
82
+ self.state = currentState
83
+ self.condition_check = Condition_check(self.statetree, self.state)
84
+
85
+
86
+
@@ -9,6 +9,20 @@ from ._Editor import _tilemapEditor
9
9
 
10
10
  class TileMap:
11
11
  def __init__(self, tileSet: str, tileDim: tuple, tileScale: float, mapDim: tuple, mapFill: int, saveFile = None):
12
+ """
13
+ Constructor for TileMap object.
14
+
15
+ Args:
16
+ tileSet (str): filepath to tileset image
17
+ tileDim (tuple): dimensions of a single tile
18
+ tileScale (float): scale of tiles relative to tileset image
19
+ mapDim (tuple): dimensions of the map
20
+ mapFill (int): default tile id to fill map with
21
+ saveFile (str): filepath to save map to (default is None)
22
+
23
+ Returns:
24
+ None
25
+ """
12
26
  self.tilesetFile = tileSet
13
27
  self.mapFile = saveFile
14
28
  self.tileDim = (tileDim[0] * tileScale, tileDim[1] * tileScale)
@@ -0,0 +1,65 @@
1
+ import pygame
2
+ import numpy as np
3
+
4
+ from ..basics._net import Global
5
+
6
+ from ..GameLevel_ui._sprites import Sprite_2d
7
+
8
+ class Image:
9
+ def __init__(self, pos: tuple, image, scale: float = 1.0):
10
+ """
11
+ Initialize an Image UI element.
12
+
13
+ Args:
14
+ pos: Tuple (x, y) for the image position
15
+ image: Either a file path (str) or pygame.Surface object
16
+ scale: Scale factor for the image (default: 1.0)
17
+ """
18
+ #add to game
19
+ self.image = Sprite_2d(pos, image, scale)
20
+ self.image.__remove__()
21
+ Global.game.ui_objs.append(self)
22
+
23
+ def move_by(self, x: int, y: int):
24
+ """
25
+ Move the image by (x, y) in world space.
26
+
27
+ Args:
28
+ x: int, the x component of the movement
29
+ y: int, the y component of the movement
30
+ """
31
+ self.image.move_by(x, y)
32
+
33
+ def move_to(self, x: int, y: int):
34
+ """
35
+ Move the image to (x, y) in world space.
36
+
37
+ Args:
38
+ x: int, the x component of the position
39
+ y: int, the y component of the position
40
+ """
41
+ self.image.move_to(x, y)
42
+
43
+ def get_pos(self):
44
+ """
45
+ Get the position of the image in world space.
46
+
47
+ Returns:
48
+ tuple: (x, y) the position of the image
49
+ """
50
+ return self.image.get_pos()
51
+
52
+ def rescale(self, scale: float):
53
+ """
54
+ Rescale the image by the given scale.
55
+
56
+ Args:
57
+ scale: float, the scale factor
58
+ """
59
+ self.image.rescale(scale)
60
+
61
+ def update(self):
62
+ """
63
+ Update the image by drawing it on the screen.
64
+ """
65
+ Global.screen.blit(self.image.image, self.image.pos)
@@ -0,0 +1,52 @@
1
+ import pygame
2
+ import os
3
+ from src.GameBox import *
4
+
5
+ width, height = 800, 600
6
+
7
+ game = Game(width, height, "blue", "First Game!")
8
+ screen = game.get_screen()
9
+
10
+ cam = Cammera()
11
+
12
+ Keys.init()
13
+
14
+ player = Player((width / 2, height / 2), (64, 64), "green", False)
15
+ player.add_physics(1.0, 3.0, 16, 7.0, 0.5)
16
+
17
+ player.sprite.add_animation_player(2.0)
18
+ player.sprite.add_animation("Walk Left", "tests/Player.png", (5, 1), (32, 32), 5, 0.075, 2.0, True, -1)
19
+ player.sprite.add_animation("Walk Right", "tests/Player.png", (5, 1), (32, 32), 5, 0.075, 2.0, True, 1)
20
+ player.sprite.add_animation("Idle", "tests/Player.png", (5, 1), (32, 32), 1, 0.075, 2.0, True, 1)
21
+
22
+ player.sprite.set_animation("Idle")
23
+
24
+
25
+ stateTree = {
26
+ "Idle": {Conditions.velocity_left: "Walk Left", Conditions.velocity_right: "Walk Right"},
27
+ "Walk Left": {Conditions.velocity_none: "Idle", Conditions.velocity_right: "Walk Right"},
28
+ "Walk Right": {Conditions.velocity_none: "Idle", Conditions.velocity_left: "Walk Left"}
29
+ }
30
+ player.sprite.set_states(stateTree, "Idle")
31
+
32
+ rect = Rect((width / 2, height / 4), (64, 64), "red", True)
33
+
34
+
35
+ cam.set_follow_target(player)
36
+ running = True
37
+ while running:
38
+ events = pygame.event.get()
39
+ for event in events:
40
+ if event.type == pygame.QUIT:
41
+ running = False
42
+
43
+ player.top_down_movement()
44
+ game.update(events, 60)
45
+
46
+ #print player state
47
+ os.system("cls")
48
+ print(player.sprite.state)
49
+
50
+ game.quit()
51
+ pygame.quit()
52
+ os.system("cls")
Binary file
@@ -17,9 +17,9 @@ map = TileMap("tests/levelTiles.png", (16, 16), 5, (25, 25), 0)
17
17
  map.load_map_from_json("tests/testMap.json")
18
18
  map.activate_editor(Keys.tab)
19
19
 
20
+ player.sprite.add_animated_sprite_2d("tests/Player.png", (5, 1), (32, 32), 5, 0.075, 2.0, True, 1)
20
21
 
21
-
22
- player.set_tilemap_sample(50)
22
+ #player.set_dim_as_sprite()
23
23
 
24
24
  cam.set_follow_target(player)
25
25
  #cam.move(-50, -50)
@@ -33,6 +33,7 @@ while running:
33
33
 
34
34
  player.top_down_movement()
35
35
 
36
+
36
37
  game.update(events, 60)
37
38
 
38
39
 
@@ -0,0 +1 @@
1
+ {"map": [[11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8], [8, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8], [11, 11, 11, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8], [16, 17, 18, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 16, 17, 17, 17, 17, 17, 17, 17, 18, 8, 8], [8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8]], "collisions": {"1": "full", "2": "halfTop", "7": "halfLeft", "3": "full", "13": "full", "15": "full", "9": "halfRight", "14": "halfBottom", "8": "none", "6": "bottomLeft", "5": "halfBottom", "4": "bottomRight", "10": "halfRight", "16": "topRight", "12": "halfLeft", "11": "none", "18": "topLeft", "17": "halfTop"}}
@@ -1,33 +0,0 @@
1
- import pygame
2
- import numpy as np
3
-
4
- from ..basics._net import Global
5
-
6
- class Rect:
7
- def __init__(self, pos: tuple, size: tuple, color: tuple = (0, 0, 0), collision: bool = True):
8
- self.x, self.y = pos
9
- self.width, self.height = size
10
- self.color = color
11
- Global.game.objs.append(self)
12
- self.collision = collision
13
-
14
- def update(self):
15
- width = self.width * Global.cam.scale
16
- height = self.height * Global.cam.scale
17
- if (Global.cam.follow) != (self):
18
- x = self.x - Global.cam.x
19
- y = self.y - Global.cam.y
20
- elif (Global.cam.follow) == (self):
21
- x = self.x
22
- y = self.y
23
-
24
- rect = pygame.Rect(x, y, width ,height)
25
- if self.collision: Global.collisions.append(rect)
26
- pygame.draw.rect(Global.screen, self.color, rect)
27
-
28
- def move(self, x, y):
29
- if (Global.cam.follow) != (self):
30
- self.x += x
31
- self.y += y
32
- else:
33
- Global.cam.move(x, y)
@@ -1,36 +0,0 @@
1
- import pygame
2
- import numpy as np
3
-
4
- from ._net import Global
5
-
6
- from ..basics.utils import moveTward
7
-
8
- class Cammera:
9
- def __init__(self, scale: float = 1.0):
10
- self.x = 0
11
- self.y = 0
12
- Global.game.objs.append(self)
13
- Global.cam = self
14
- self.follow = None
15
- self.diff = (0, 0)
16
- self.scale = scale
17
-
18
- def move(self, x, y):
19
- self.x += x
20
- self.y += y
21
-
22
- def update(self):
23
- return
24
- if self.follow is not None:
25
- self.x = (self.follow.x - self.diff[0])
26
- self.y = (self.follow.y - self.diff[1])
27
-
28
- def set_follow_target(self, target: object):
29
- self.follow = target
30
- print(target)
31
- self.diff = (target.x - self.x, target.y - self.y)
32
-
33
- def set_scale(self, scale: float = 1.0):
34
- self.scale = scale
35
- def change_scale(self, scale: float = 1.0):
36
- self.scale += scale
@@ -1 +0,0 @@
1
- {"map": [[11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 1, 2, 3, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 7, 8, 9, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 13, 14, 15, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 4, 5, 6, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 10, 11, 12, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 16, 17, 18, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8], [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8]], "collisions": {"1": "full", "2": "halfTop", "7": "halfLeft", "3": "full", "13": "full", "15": "full", "9": "halfRight", "14": "halfBottom", "8": "none", "6": "bottomLeft", "5": "halfBottom", "4": "bottomRight", "10": "halfRight", "16": "topRight", "12": "halfLeft", "11": "none", "18": "topLeft", "17": "halfTop"}}
File without changes
File without changes
File without changes
File without changes