batframework 1.0.9a7__py3-none-any.whl → 1.0.9a9__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.
- batFramework/__init__.py +20 -11
- batFramework/action.py +1 -1
- batFramework/animatedSprite.py +47 -116
- batFramework/animation.py +30 -5
- batFramework/audioManager.py +8 -5
- batFramework/baseScene.py +240 -0
- batFramework/camera.py +4 -0
- batFramework/constants.py +6 -2
- batFramework/cutscene.py +221 -21
- batFramework/cutsceneManager.py +5 -2
- batFramework/drawable.py +7 -5
- batFramework/easingController.py +10 -11
- batFramework/entity.py +21 -2
- batFramework/enums.py +48 -33
- batFramework/gui/__init__.py +6 -3
- batFramework/gui/animatedLabel.py +10 -2
- batFramework/gui/button.py +4 -31
- batFramework/gui/clickableWidget.py +63 -50
- batFramework/gui/constraints/constraints.py +212 -136
- batFramework/gui/container.py +77 -58
- batFramework/gui/debugger.py +12 -17
- batFramework/gui/draggableWidget.py +21 -17
- batFramework/gui/image.py +3 -10
- batFramework/gui/indicator.py +56 -1
- batFramework/gui/interactiveWidget.py +127 -108
- batFramework/gui/label.py +73 -64
- batFramework/gui/layout.py +286 -445
- batFramework/gui/meter.py +42 -20
- batFramework/gui/radioButton.py +20 -69
- batFramework/gui/root.py +99 -29
- batFramework/gui/selector.py +250 -0
- batFramework/gui/shape.py +13 -5
- batFramework/gui/slider.py +262 -107
- batFramework/gui/syncedVar.py +49 -0
- batFramework/gui/textInput.py +46 -22
- batFramework/gui/toggle.py +70 -52
- batFramework/gui/tooltip.py +30 -0
- batFramework/gui/widget.py +222 -135
- batFramework/manager.py +7 -8
- batFramework/particle.py +4 -1
- batFramework/propertyEaser.py +79 -0
- batFramework/renderGroup.py +17 -50
- batFramework/resourceManager.py +43 -13
- batFramework/scene.py +15 -335
- batFramework/sceneLayer.py +138 -0
- batFramework/sceneManager.py +31 -36
- batFramework/scrollingSprite.py +8 -3
- batFramework/sprite.py +1 -1
- batFramework/templates/__init__.py +1 -2
- batFramework/templates/controller.py +97 -0
- batFramework/timeManager.py +76 -22
- batFramework/transition.py +37 -103
- batFramework/utils.py +125 -66
- {batframework-1.0.9a7.dist-info → batframework-1.0.9a9.dist-info}/METADATA +24 -3
- batframework-1.0.9a9.dist-info/RECORD +67 -0
- {batframework-1.0.9a7.dist-info → batframework-1.0.9a9.dist-info}/WHEEL +1 -1
- batFramework/character.py +0 -27
- batFramework/templates/character.py +0 -43
- batFramework/templates/states.py +0 -166
- batframework-1.0.9a7.dist-info/RECORD +0 -63
- /batframework-1.0.9a7.dist-info/LICENCE → /batframework-1.0.9a9.dist-info/LICENSE +0 -0
- {batframework-1.0.9a7.dist-info → batframework-1.0.9a9.dist-info}/top_level.txt +0 -0
batFramework/templates/states.py
DELETED
@@ -1,166 +0,0 @@
|
|
1
|
-
import batFramework as bf
|
2
|
-
from typing import TYPE_CHECKING
|
3
|
-
|
4
|
-
if TYPE_CHECKING:
|
5
|
-
from .character import Platform2DCharacter
|
6
|
-
|
7
|
-
|
8
|
-
class CharacterState(bf.State):
|
9
|
-
def set_parent(self, parent):
|
10
|
-
"""Initialize the parent character."""
|
11
|
-
res = super().set_parent(parent)
|
12
|
-
if res:
|
13
|
-
self.parent: Platform2DCharacter = parent
|
14
|
-
return res
|
15
|
-
|
16
|
-
def on_enter(self):
|
17
|
-
"""Handle state entry."""
|
18
|
-
self.parent.set_animation(self.name)
|
19
|
-
|
20
|
-
def handle_input(self):
|
21
|
-
"""Process input and update movement direction."""
|
22
|
-
if self.parent.actions.is_active("right"):
|
23
|
-
self._apply_horizontal_input(self.parent.acceleration, self.parent.speed)
|
24
|
-
if self.parent.actions.is_active("left"):
|
25
|
-
self._apply_horizontal_input(-self.parent.acceleration, -self.parent.speed)
|
26
|
-
|
27
|
-
if self.parent.velocity.x > 0:
|
28
|
-
self.parent.set_flipX(False)
|
29
|
-
elif self.parent.velocity.x < 0:
|
30
|
-
self.parent.set_flipX(True)
|
31
|
-
|
32
|
-
|
33
|
-
def _apply_horizontal_input(self, acceleration, limit):
|
34
|
-
"""Apply input acceleration and enforce speed limit."""
|
35
|
-
|
36
|
-
self.parent.velocity.x += acceleration
|
37
|
-
if abs(self.parent.velocity.x) > abs(limit):
|
38
|
-
self.parent.velocity.x = limit
|
39
|
-
|
40
|
-
def apply_friction(self):
|
41
|
-
"""Apply friction to horizontal velocity."""
|
42
|
-
if (self.parent.actions.is_active("right") or self.parent.actions.is_active("left")):
|
43
|
-
return
|
44
|
-
|
45
|
-
if abs(self.parent.velocity.x) < 0.01: # Threshold for negligible velocity
|
46
|
-
self.parent.velocity.x = 0
|
47
|
-
else:
|
48
|
-
self.parent.velocity.x *= self.parent.friction
|
49
|
-
|
50
|
-
def apply_gravity(self, dt):
|
51
|
-
"""Apply gravity to vertical velocity."""
|
52
|
-
self.parent.velocity.y += self.parent.gravity * dt
|
53
|
-
self.parent.velocity.y = min(self.parent.velocity.y, self.parent.terminal_velocity)
|
54
|
-
|
55
|
-
def move_character(self, dt):
|
56
|
-
"""Move the character based on velocity."""
|
57
|
-
self.parent.rect.x += self.parent.velocity.x * dt
|
58
|
-
self.parent.rect.y += self.parent.velocity.y * dt
|
59
|
-
|
60
|
-
def update(self, dt):
|
61
|
-
"""Update the character state."""
|
62
|
-
self.handle_input()
|
63
|
-
self.apply_physics(dt)
|
64
|
-
self.handle_collision()
|
65
|
-
|
66
|
-
def apply_physics(self, dt):
|
67
|
-
"""Apply all physics effects."""
|
68
|
-
self.apply_friction()
|
69
|
-
self.move_character(dt)
|
70
|
-
if self.parent.on_ground:
|
71
|
-
self.parent.velocity.y = 0 # Stop downward movement on ground
|
72
|
-
|
73
|
-
def handle_collision(self):
|
74
|
-
"""Placeholder for collision detection and resolution."""
|
75
|
-
pass # Future collision code goes here
|
76
|
-
|
77
|
-
|
78
|
-
class Platform2DIdle(CharacterState):
|
79
|
-
def __init__(self) -> None:
|
80
|
-
super().__init__("idle")
|
81
|
-
|
82
|
-
def on_enter(self):
|
83
|
-
self.parent.jump_counter = 0
|
84
|
-
super().on_enter()
|
85
|
-
|
86
|
-
def update(self, dt):
|
87
|
-
super().update(dt)
|
88
|
-
|
89
|
-
if not self.parent.on_ground:
|
90
|
-
self.parent.set_state("fall")
|
91
|
-
elif self.parent.velocity.x != 0:
|
92
|
-
self.parent.set_state("run")
|
93
|
-
elif self.parent.actions.is_active("jump"):
|
94
|
-
self.parent.set_state("jump")
|
95
|
-
|
96
|
-
|
97
|
-
class Platform2DRun(CharacterState):
|
98
|
-
def __init__(self) -> None:
|
99
|
-
super().__init__("run")
|
100
|
-
|
101
|
-
|
102
|
-
def on_enter(self):
|
103
|
-
self.parent.jump_counter = 0
|
104
|
-
super().on_enter()
|
105
|
-
|
106
|
-
def update(self, dt):
|
107
|
-
super().update(dt)
|
108
|
-
|
109
|
-
if self.parent.velocity.x :
|
110
|
-
if (self.parent.actions.is_active("right") or self.parent.actions.is_active("left")):
|
111
|
-
if self.parent.get_current_animation().name != "run" : self.parent.set_animation("run")
|
112
|
-
else:
|
113
|
-
if self.parent.get_current_animation().name != "idle" : self.parent.set_animation("idle")
|
114
|
-
|
115
|
-
if self.parent.actions.is_active("jump"):
|
116
|
-
self.parent.set_state("jump")
|
117
|
-
elif self.parent.velocity.x == 0:
|
118
|
-
if not (self.parent.actions.is_active("right") or self.parent.actions.is_active("left")):
|
119
|
-
self.parent.set_state("idle")
|
120
|
-
elif not self.parent.on_ground:
|
121
|
-
self.parent.set_state("fall")
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
class Platform2DJump(CharacterState):
|
127
|
-
def __init__(self) -> None:
|
128
|
-
super().__init__("jump")
|
129
|
-
|
130
|
-
def on_enter(self):
|
131
|
-
super().on_enter()
|
132
|
-
self.parent.on_ground = False
|
133
|
-
self.parent.velocity.y = -self.parent.jump_force
|
134
|
-
self.parent.jump_counter += 1
|
135
|
-
|
136
|
-
def update(self, dt):
|
137
|
-
super().update(dt)
|
138
|
-
self.apply_gravity(dt)
|
139
|
-
|
140
|
-
|
141
|
-
if self.parent.jump_counter < self.parent.max_jumps:
|
142
|
-
if self.parent.actions.is_active("jump") and (self.parent.velocity.y//10)*10 == 0:
|
143
|
-
self.parent.set_state("jump")
|
144
|
-
return
|
145
|
-
|
146
|
-
|
147
|
-
if self.parent.velocity.y > 0:
|
148
|
-
self.parent.set_state("fall")
|
149
|
-
|
150
|
-
|
151
|
-
class Platform2DFall(CharacterState):
|
152
|
-
def __init__(self) -> None:
|
153
|
-
super().__init__("fall")
|
154
|
-
|
155
|
-
def update(self, dt):
|
156
|
-
super().update(dt)
|
157
|
-
self.apply_gravity(dt)
|
158
|
-
|
159
|
-
if self.parent.on_ground:
|
160
|
-
if abs(self.parent.velocity.x) > 0.01:
|
161
|
-
self.parent.set_state("run")
|
162
|
-
else:
|
163
|
-
self.parent.set_state("idle")
|
164
|
-
|
165
|
-
if self.parent.actions.is_active("jump") and self.parent.jump_counter < self.parent.max_jumps:
|
166
|
-
self.parent.set_state("jump")
|
@@ -1,63 +0,0 @@
|
|
1
|
-
batFramework/__init__.py,sha256=Wu_8kpeyR_XgD5zewnX_xXAF8CwStcO7vivideqsgIw,2590
|
2
|
-
batFramework/action.py,sha256=919IVYKviLyVYDtQL7oZvlVuE_aodjJCuwz6fGi5sCk,8420
|
3
|
-
batFramework/actionContainer.py,sha256=qy6-YY3iX26KJ8NqFMSYo6JExohD8HFk0sC1qhb7qA8,2602
|
4
|
-
batFramework/animatedSprite.py,sha256=IWE8zUgpFaqQPUr7iOUo7TJ_E10aUaMNqlIqv8dW87E,4242
|
5
|
-
batFramework/animation.py,sha256=_XcH6r3TVQZUcLbhzUnTNlXrjy-J-nYiRmFpxvTYEoc,1934
|
6
|
-
batFramework/audioManager.py,sha256=_TtLnkxOo08mxPDtzMC4cuK94eqZhslO5q_FEsZRaU0,3850
|
7
|
-
batFramework/camera.py,sha256=tSy9n20QLeJD3Uz352q-uejzAHPtQczvahaNz7APJcY,9408
|
8
|
-
batFramework/character.py,sha256=AK5sQLvAOY3X4-7vzeHeIO5WDFsubn_TADLYxmYc0Qo,789
|
9
|
-
batFramework/constants.py,sha256=x8a0GqBJdiwMEjlVohyL3AWHaSxyrBy-4pucVKVNakg,1354
|
10
|
-
batFramework/cutscene.py,sha256=UOz3NApbz4W7Wi6wD_ZEmkxaZCAWt1YWh5ZFzXw5Xco,1749
|
11
|
-
batFramework/cutsceneManager.py,sha256=mvBR4KOv6KV9eHzhYH7r6IJMVLjM71C30C2OuvwbuSU,945
|
12
|
-
batFramework/drawable.py,sha256=5We2ITq3M5ERG22-iQw7Mo_1LNo0nqma1P13tvphDjY,2197
|
13
|
-
batFramework/dynamicEntity.py,sha256=SjXShy5aT4cQzjlTem05zSQRiNeq52AUXEBVodEG6gI,736
|
14
|
-
batFramework/easingController.py,sha256=ql_nt8unwUZLy7MC7unzDn5eTW44VtjrOTCDs8WS0eY,1750
|
15
|
-
batFramework/entity.py,sha256=wMQKR6IxQ69vtPY4nGsz7WnY9ApPhO_VY08IYx6yUu8,2910
|
16
|
-
batFramework/enums.py,sha256=xkT4yepdLLQn-5YWoSxhHamXE7w_M-GIw47dWWHfKIs,2185
|
17
|
-
batFramework/fontManager.py,sha256=M7h6AVq9Fwr51UTCFoGsg_PSurdjByA4w8qouXq4EKE,2254
|
18
|
-
batFramework/manager.py,sha256=TQ0Q1f_GbQE8h4G9zCNQgtNTKNCj630S43Ai4e0yZik,4488
|
19
|
-
batFramework/particle.py,sha256=Aps9eJNdFag-TlduMSezKp4ocFQVvI6iZ98chhdhbgE,3081
|
20
|
-
batFramework/renderGroup.py,sha256=CO8LtTP1gYI1i_8OwmMk2SlU33Nv4iXnHvK0RVK3D24,2026
|
21
|
-
batFramework/resourceManager.py,sha256=0cOIAFXT7UzzvgHn9QkWcXsTp8H2bIS70NvvgpBL2_4,3554
|
22
|
-
batFramework/scene.py,sha256=0E7omgNUEl5Uhbx8iO3exyCy4p1MC7bSvqfwncW4KMw,11281
|
23
|
-
batFramework/sceneManager.py,sha256=GCGt7DYoty_wX2LVEhv0C6TaNyNWhKvWocwOqxUIBXc,7099
|
24
|
-
batFramework/scrollingSprite.py,sha256=6FFS27kPaPto6-lIM7k3zHW1pnlEJ4mFopYP_tyvzb0,3917
|
25
|
-
batFramework/sprite.py,sha256=Cz8qzl8jR8y33DUSCObJQOk5e8PcZeavtFhBdR2TogU,1627
|
26
|
-
batFramework/stateMachine.py,sha256=wC-5xbKvf-vGm_N16X9KhgMya5915GyVXL79uk5Bapw,1359
|
27
|
-
batFramework/tileset.py,sha256=3AJBWHx90PC43BdLYCBFm811XBrMvWoB-nsUgyo6s-I,1728
|
28
|
-
batFramework/timeManager.py,sha256=TT_pynpS1wYmSK6s8ksQTt-coR9EeB0mYimhq5yrK08,4975
|
29
|
-
batFramework/transition.py,sha256=tKthKfGyv1V39eIiNGSGL---KcZXix3YIGg9RirOcLc,6809
|
30
|
-
batFramework/triggerZone.py,sha256=MaPp20UoyRHAMiN0_sBanJJ_0cWnYXZEeY-BEaDTDxQ,652
|
31
|
-
batFramework/utils.py,sha256=vfndaYn4wMy0W746C6oCWCvnUyk9BxPL2vIpGyEDssU,9958
|
32
|
-
batFramework/gui/__init__.py,sha256=OFAKZkafWX-BfDjF4MILmigVT1lywnsfH2pOIJwUybY,691
|
33
|
-
batFramework/gui/animatedLabel.py,sha256=KePSSd6bTeJ5UXoPUpvY7QRx5Uah5-qpBDGby6xRgqU,2752
|
34
|
-
batFramework/gui/button.py,sha256=p_wMcaijpUbNuoRBNkhplrZqsB3gdl7mVpduR-UFm_4,1803
|
35
|
-
batFramework/gui/clickableWidget.py,sha256=8wHuH_aBuNrzG5_YZLfmtc65n0jtlDrJV3rFd9M4QSg,7477
|
36
|
-
batFramework/gui/container.py,sha256=2EIPpumiswH365Tq-3iF2FzApY2T440O9qijAx7SkpU,6280
|
37
|
-
batFramework/gui/debugger.py,sha256=0w2B4qQ5MeFwwP46zG7KTzIFzh2fmtU10UH96b_hT9Y,3997
|
38
|
-
batFramework/gui/draggableWidget.py,sha256=SKG7oMInZ_GTnrbv2T0aqlppuiuLX1tkVSCQJtRMlk8,1392
|
39
|
-
batFramework/gui/image.py,sha256=CPDSF7Fz1zmGAK-ii7R4MIAD5EZCnPw4mpD_cGv77U8,1925
|
40
|
-
batFramework/gui/indicator.py,sha256=31QAyvT9w-eCWUSoK4pV-4TsTzFvkY_g5snoeI1hATM,1619
|
41
|
-
batFramework/gui/interactiveWidget.py,sha256=ww9WsR2Y87og7NtnzCcyc1zIPE-Bjtn0YZ0SOfKMUbQ,6633
|
42
|
-
batFramework/gui/label.py,sha256=6GY_2f4el1KmJ3JoLgE57oPl7Xdbx1codaHdAW3h_x0,11639
|
43
|
-
batFramework/gui/layout.py,sha256=MJjcz6fjTWtt4-Td0dAqKd3XRDlRJ5QaDpRbdYEj1w8,21661
|
44
|
-
batFramework/gui/meter.py,sha256=RFzAhSzR3O-Pw0wjdfApWGWFQSJoYa4WohkiREDAAJc,2395
|
45
|
-
batFramework/gui/radioButton.py,sha256=DgCtN1j1s2rUITpdYqArqQ36NnNGump7FiTe_ndEzJg,2436
|
46
|
-
batFramework/gui/root.py,sha256=r8dhI2xd2h5bUbTe4x_On77BTTZ7Sf8qY5wWJimWXds,5078
|
47
|
-
batFramework/gui/shape.py,sha256=PSQRqa8jYA8VsBXRQcpcCuEvTYmWDW8zJkzA_eRFPIo,9349
|
48
|
-
batFramework/gui/slider.py,sha256=rt0f2jnxyd89uepyBqBueP3qw6y9ZTIRGXipI9fhBs4,8467
|
49
|
-
batFramework/gui/style.py,sha256=OeLbft0RkIslQ2IcZpBeF6TaQDONIoBcAHj_Bkh9gFw,131
|
50
|
-
batFramework/gui/styleManager.py,sha256=mg9VbK0Ux9pwTbq9oICilnQG3xJLnnZEjOzzSg0IVpY,1424
|
51
|
-
batFramework/gui/textInput.py,sha256=v4r110mYmPj0RB97DsCG81U06dUd-7cnNeBj-mnbdiE,11002
|
52
|
-
batFramework/gui/toggle.py,sha256=icvg0GY0pErCZPWoje_SO7L6Ik_sM--XHTM-pUAwdY8,3997
|
53
|
-
batFramework/gui/widget.py,sha256=KrkQH8Z2tSVcnCHhet-xXlHy3SqSjHByBQVNoTOs54E,14597
|
54
|
-
batFramework/gui/constraints/__init__.py,sha256=qqXE8nnSrEvCSeHdqY8UYPZLetqdubFPI7IdZuh35QE,26
|
55
|
-
batFramework/gui/constraints/constraints.py,sha256=XFvrjFFN1nmbYzI6l54DlZkrRP-wWXfgXrtE4T5egCA,29707
|
56
|
-
batFramework/templates/__init__.py,sha256=8XN-7JwYFKTRx_lnUL_If3spwgn5_2b7bwmrRRBPON0,46
|
57
|
-
batFramework/templates/character.py,sha256=4UEcegUIeIgj48sVgzyRcT6yjpFOZ8Q_gHTtiB5j6kw,1348
|
58
|
-
batFramework/templates/states.py,sha256=WeomVrQ10vHxVCj9Wnk1PcinKyb871uV910mQe287kI,5370
|
59
|
-
batframework-1.0.9a7.dist-info/LICENCE,sha256=A65iXbMDbOxQLDNOODJLqA7o5RxszYlEqIgNSzBQRf4,1073
|
60
|
-
batframework-1.0.9a7.dist-info/METADATA,sha256=-k4nsIYu17ETK8XuTqXQC3tATx_YYMgFiFBRJqvwoeA,1694
|
61
|
-
batframework-1.0.9a7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
62
|
-
batframework-1.0.9a7.dist-info/top_level.txt,sha256=vxAKBIk1oparFTxeXGBrgfIO7iq_YR5Fv1JvPVAIwmA,13
|
63
|
-
batframework-1.0.9a7.dist-info/RECORD,,
|
File without changes
|
File without changes
|