batframework 1.0.8a2__py3-none-any.whl → 1.0.8a3__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.
Files changed (65) hide show
  1. batFramework/__init__.py +53 -50
  2. batFramework/action.py +126 -99
  3. batFramework/actionContainer.py +53 -9
  4. batFramework/animatedSprite.py +115 -65
  5. batFramework/audioManager.py +69 -26
  6. batFramework/camera.py +259 -69
  7. batFramework/constants.py +16 -54
  8. batFramework/cutscene.py +36 -29
  9. batFramework/cutsceneBlocks.py +37 -42
  10. batFramework/dynamicEntity.py +9 -7
  11. batFramework/easingController.py +58 -0
  12. batFramework/entity.py +48 -97
  13. batFramework/enums.py +113 -0
  14. batFramework/fontManager.py +65 -0
  15. batFramework/gui/__init__.py +10 -2
  16. batFramework/gui/button.py +9 -78
  17. batFramework/gui/clickableWidget.py +219 -0
  18. batFramework/gui/constraints/__init__.py +1 -0
  19. batFramework/gui/constraints/constraints.py +590 -0
  20. batFramework/gui/container.py +174 -32
  21. batFramework/gui/debugger.py +131 -43
  22. batFramework/gui/dialogueBox.py +99 -0
  23. batFramework/gui/draggableWidget.py +40 -0
  24. batFramework/gui/image.py +54 -18
  25. batFramework/gui/indicator.py +38 -21
  26. batFramework/gui/interactiveWidget.py +177 -13
  27. batFramework/gui/label.py +288 -74
  28. batFramework/gui/layout.py +219 -60
  29. batFramework/gui/meter.py +71 -0
  30. batFramework/gui/radioButton.py +84 -0
  31. batFramework/gui/root.py +128 -38
  32. batFramework/gui/shape.py +253 -57
  33. batFramework/gui/slider.py +246 -0
  34. batFramework/gui/style.py +10 -0
  35. batFramework/gui/styleManager.py +48 -0
  36. batFramework/gui/textInput.py +137 -0
  37. batFramework/gui/toggle.py +115 -51
  38. batFramework/gui/widget.py +329 -254
  39. batFramework/manager.py +40 -19
  40. batFramework/object.py +114 -0
  41. batFramework/particle.py +101 -0
  42. batFramework/renderGroup.py +67 -0
  43. batFramework/resourceManager.py +84 -0
  44. batFramework/scene.py +242 -114
  45. batFramework/sceneManager.py +145 -107
  46. batFramework/scrollingSprite.py +115 -0
  47. batFramework/sprite.py +51 -0
  48. batFramework/stateMachine.py +2 -2
  49. batFramework/tileset.py +46 -0
  50. batFramework/time.py +117 -57
  51. batFramework/transition.py +184 -126
  52. batFramework/utils.py +31 -156
  53. batframework-1.0.8a3.dist-info/LICENCE +21 -0
  54. batframework-1.0.8a3.dist-info/METADATA +55 -0
  55. batframework-1.0.8a3.dist-info/RECORD +58 -0
  56. batFramework/debugger.py +0 -48
  57. batFramework/easing.py +0 -71
  58. batFramework/gui/constraints.py +0 -204
  59. batFramework/gui/frame.py +0 -19
  60. batFramework/particles.py +0 -77
  61. batFramework/transitionManager.py +0 -0
  62. batframework-1.0.8a2.dist-info/METADATA +0 -58
  63. batframework-1.0.8a2.dist-info/RECORD +0 -42
  64. {batframework-1.0.8a2.dist-info → batframework-1.0.8a3.dist-info}/WHEEL +0 -0
  65. {batframework-1.0.8a2.dist-info → batframework-1.0.8a3.dist-info}/top_level.txt +0 -0
batFramework/gui/frame.py DELETED
@@ -1,19 +0,0 @@
1
- import batFramework as bf
2
- from .shape import Shape
3
- import pygame
4
-
5
-
6
- class Frame(Shape):
7
- def __init__(self,width:float,height:float):
8
- super().__init__(width,height)
9
- self.set_debug_color("magenta")
10
-
11
- def to_string_id(self)->str:
12
- return "Frame"
13
-
14
- def children_modified(self)->None:
15
- print(self.children)
16
- self.set_size(
17
- *self.inflate_rect_by_padding(self.rect.unionall(list(c.rect for c in self.children))).size
18
- )
19
- super().children_modified()
batFramework/particles.py DELETED
@@ -1,77 +0,0 @@
1
- import batFramework as bf
2
- import pygame
3
- from pygame.math import Vector2
4
-
5
-
6
- class Particle:
7
- def __init__(
8
- self,
9
- start_pos: tuple[float, float],
10
- start_vel: tuple[float, float],
11
- duration=1000,
12
- color=None,
13
- size = (4,4)
14
- ):
15
- self.rect = pygame.FRect(*start_pos, 0, 0)
16
- self.surface = pygame.Surface(size).convert()
17
- if color:
18
- self.surface.fill(color)
19
- self.velocity = Vector2(*start_vel)
20
- self.start_time = pygame.time.get_ticks()
21
- self.duration = duration
22
- self.dead = False
23
- self.progression = 0
24
- self.z_depth = 1
25
-
26
- def update(self, dt):
27
- if self.dead:
28
- return
29
- elapsed_time = pygame.time.get_ticks() - self.start_time
30
- self.progression = elapsed_time / self.duration
31
- self.dead = elapsed_time >= self.duration
32
- self.rect.center += self.velocity * dt
33
- self.update_surface()
34
-
35
- def kill(self):
36
- self.dead = True
37
-
38
- def update_surface(self):
39
- self.surface.set_alpha(255 - int(self.progression * 255))
40
-
41
-
42
- class ParticleManager(bf.Entity):
43
- def __init__(self) -> None:
44
- super().__init__(size=bf.const.RESOLUTION)
45
- self.particles: list[Particle] = []
46
-
47
- def get_bounding_box(self):
48
- for particle in self.particles:
49
- yield particle.rect
50
-
51
- def add_particle(self, particle_class=Particle, **kwargs):
52
- self.particles.append(particle_class(**kwargs))
53
-
54
-
55
- def clear(self):
56
- self.particles = []
57
-
58
-
59
- def update(self, dt: float):
60
- particles_to_remove = []
61
- for particle in self.particles:
62
- particle.update(dt)
63
- if particle.dead:
64
- particles_to_remove.append(particle)
65
- for p in particles_to_remove:
66
- self.particles.remove(p)
67
-
68
- def draw(self, camera) -> bool:
69
- camera.surface.fblits(
70
- [
71
- (
72
- p.surface,
73
- tuple(round(i * self.z_depth) for i in camera.transpose(self.rect).topleft)
74
- ) for p in self.particles
75
- ]
76
- )
77
- return len(self.particles)
File without changes
@@ -1,58 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: batframework
3
- Version: 1.0.8a2
4
- Summary: Pygame framework for making games easier.
5
- Author-email: Turan Baturay <baturayturan@gmail.com>
6
- Project-URL: Homepage, https://github.com/TuranBaturay/batFramework
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: License :: OSI Approved :: MIT License
9
- Classifier: Operating System :: OS Independent
10
- Requires-Python: >=3.10
11
- Description-Content-Type: text/markdown
12
- Requires-Dist: pygame-ce
13
-
14
- # batFramework
15
-
16
- batFramework is a Python game framework built using Pygame, designed to simplify game development by providing entities, scenes, a scene manager, and various utilities.
17
-
18
- ## Purpose and Overview
19
- The primary objective of batFramework is to streamline game development by utilizing entities and scenes that hold entities. It employs a manager, which inherits from the scene manager, to handle scenes, propagate events, and manage updates and rendering.
20
-
21
- ## Installation and Setup
22
- To install batFramework, you can use pip:
23
- ```pip install batFramework```
24
-
25
-
26
- The only dependency required is pygame-ce.
27
-
28
- ## Usage Instructions
29
- To create a basic app using batFramework, here's an example:
30
-
31
- ```python
32
- import batFramework as bf
33
-
34
- # Initialize the framework
35
- bf.init((1280, 720), window_title="My Amazing Program")
36
-
37
- # Create a manager and a scene
38
- bf.Manager(bf.Scene("main")).run()
39
- ```
40
- In practice, users can inherit bf.Scene to create their own scenes, adding specific behaviors, entities, etc.
41
-
42
- ## Features and Functionalities
43
-
44
- - Scene management for organizing game components
45
- - Cutscene support to facilitate storytelling sequences
46
- - Audio management for music and sound effects with volume control
47
- - Entity, sprite, and animated sprite support
48
- - Utility modules such as time management and easingAnimation
49
-
50
- Users can leverage these functionalities to build games efficiently using batFramework.
51
-
52
- For more detailed usage and examples, please refer to the documentation or codebase.
53
-
54
-
55
- # License
56
- MIT License
57
-
58
-
@@ -1,42 +0,0 @@
1
- batFramework/__init__.py,sha256=MLVXC2ymkO3k8LdCgB6TbahgJfhxk4GKAbmndmEgZS4,2146
2
- batFramework/action.py,sha256=Phk6-q2P-XyV2GVlXPpxyje0due4fIrKnhI1_4anfjI,7600
3
- batFramework/actionContainer.py,sha256=K9dIgG559ckxzRB3t-lpON4dFTcM2mcKZfsf4bhuJ1k,1092
4
- batFramework/animatedSprite.py,sha256=kJPKrTOfkbQu2uYDziIEop1z6-gjBwZxkC1Rxd_vBwE,3992
5
- batFramework/audioManager.py,sha256=5UsDPy4zsDO7Va1y1kM4lSpEJXU95o9F01E-Sts3osg,2546
6
- batFramework/camera.py,sha256=wt4TyWTgQmQElBVeFI7ONzNI75r0FKtB3KmNH00GeFM,4322
7
- batFramework/constants.py,sha256=FSyEYLxdAb3JaXA11sAwZBfAImedASohpFcd_7qnG0I,2075
8
- batFramework/cutscene.py,sha256=5aiIQeWGmvHCb-N3vjmwxhE4dCXv3iZRFHiexSNxCXM,3650
9
- batFramework/cutsceneBlocks.py,sha256=1gmof0jKJ8SqE-RoErm6n1A0JJ4Ang9Q30xEZnW9NaI,5123
10
- batFramework/debugger.py,sha256=gh5kOUmGr4t-BFXA17tImid4nzxUqrhsUhE_JV9srNg,1671
11
- batFramework/dynamicEntity.py,sha256=REIqH0jnfX6yUThoQNkQrsG0390TR6C5la1h2MAioYk,665
12
- batFramework/easing.py,sha256=vGkk7FDPj27X7NCJXALCEyVKDbpXXebWYtMvxkbhOh0,2217
13
- batFramework/entity.py,sha256=Tw4_PIA_sY8fhbj9TjE6wPcDTrZZX_Tj7l8oKquqe8U,3178
14
- batFramework/manager.py,sha256=LdiQVyuPQE23jwO4EjR4zqDymxtRmthUJ7VE7RIEDpU,1583
15
- batFramework/particles.py,sha256=PX8zSqOS1gyDloGAz3fAlrto51lWMUpBXDIM152EYWc,2172
16
- batFramework/scene.py,sha256=KM1e53ZfPvuJoSGQZaEl_IouWRYCbFq0QOYTuXYCr-E,7324
17
- batFramework/sceneManager.py,sha256=sFkQbfMuR19M4duvCf0SOxSY7MkMrkmiiKh72-tC1nI,5743
18
- batFramework/stateMachine.py,sha256=_er9_dcm6MLmlTjXTVm175eqZ9puaKb31PFmNPRhcSU,1338
19
- batFramework/time.py,sha256=iGV9mxUFrdXsvm4fJ1faX-VYNsOH7DX2N_aXsDRHhmM,2403
20
- batFramework/transition.py,sha256=wmL1Mgg_xopzeDbEPJyAmllLB2BCRJZtuMOR7Mez480,4873
21
- batFramework/transitionManager.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- batFramework/triggerZone.py,sha256=ikOOlJT1KIND0MO2xiilCHuKlb1eQhkCMEhZTi1btsI,586
23
- batFramework/utils.py,sha256=EUB3bMldWTYFVZxcJk5_7XAWcEz080P7PT5ZtkO5TAQ,6164
24
- batFramework/gui/__init__.py,sha256=azu5HpC8Q9kupythU5GN5blt7K9oH55oXlOeXsIw1Mw,391
25
- batFramework/gui/button.py,sha256=05RMQ20P5npgU9QmiT8v6abJhnhjqRgYbpZGaQXr6Bg,2703
26
- batFramework/gui/constraints.py,sha256=pUTNwJqI2Tu57l8ZeQXVXg3b5F5t3aR4Us-CD5qXwnM,7544
27
- batFramework/gui/container.py,sha256=XAkPZ0BOVXxzxWP5mKDF_MjYPPPAmUBY-J5zIadO0wQ,1480
28
- batFramework/gui/debugger.py,sha256=JORHcSYQQCZ0tDzjnNQvDSOOjZVwEQLeqlr8e6xk2RI,1379
29
- batFramework/gui/frame.py,sha256=zjHwbQT1fpRuvNgfBGZhMO_GdMEWqExa5dNlN9kUnUM,514
30
- batFramework/gui/image.py,sha256=goOcPntsJeTb3LR7avzi4cXfYHwyGb0KXYttbCiE6fA,777
31
- batFramework/gui/indicator.py,sha256=OgqDFsi2HCfbSzVjHkHO_shmo4q4ro3wfd0LWSLTJeQ,957
32
- batFramework/gui/interactiveWidget.py,sha256=rRElxI1eFkvOeTfTaA6f8kVTOswOD-DFLAJDUCAI_Yk,641
33
- batFramework/gui/label.py,sha256=EO1J5zPVe1skHz-KVqXKBZVKug8UVJUCXyHnvdRDuig,3586
34
- batFramework/gui/layout.py,sha256=HyVhYTy1AQacALg6XMY5aX5lj7WY__HCCh8sTSBXwgI,3210
35
- batFramework/gui/root.py,sha256=mhlu8ohqq8N-8q__ugv_tGRgPv-1jIHXBFezMFZ4mUM,1763
36
- batFramework/gui/shape.py,sha256=CYaD0BdCiuGJO_tS2pALfKPlNGaGRNPzvy-Lk08_R8g,2490
37
- batFramework/gui/toggle.py,sha256=jAeEyQXA893gDBUmjN7aoGgfsVln5RTODpSFB4LxwTY,2020
38
- batFramework/gui/widget.py,sha256=1PkxThmet8nI5rvSDE6-iPtD_DsZkk-OxriZHbBZaFc,10509
39
- batframework-1.0.8a2.dist-info/METADATA,sha256=YnyIVG7YvAIqBiqWVbeQ6h4tWUT7VHAHUr_Is1uQyJw,1980
40
- batframework-1.0.8a2.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
41
- batframework-1.0.8a2.dist-info/top_level.txt,sha256=vxAKBIk1oparFTxeXGBrgfIO7iq_YR5Fv1JvPVAIwmA,13
42
- batframework-1.0.8a2.dist-info/RECORD,,