PygameToolsKit 1.2.3__py3-none-any.whl → 1.2.5__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.
- PygameToolsKit/Animation/animation.py +9 -7
- PygameToolsKit/Inputs/joystickManager.py +8 -0
- {pygametoolskit-1.2.3.dist-info → pygametoolskit-1.2.5.dist-info}/METADATA +1 -1
- {pygametoolskit-1.2.3.dist-info → pygametoolskit-1.2.5.dist-info}/RECORD +6 -6
- {pygametoolskit-1.2.3.dist-info → pygametoolskit-1.2.5.dist-info}/WHEEL +0 -0
- {pygametoolskit-1.2.3.dist-info → pygametoolskit-1.2.5.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import pygame
|
|
2
2
|
|
|
3
|
+
from ..Update.update import Update
|
|
3
4
|
|
|
4
5
|
class Animation:
|
|
5
6
|
|
|
@@ -18,11 +19,12 @@ class Animation:
|
|
|
18
19
|
def start_animation(self):
|
|
19
20
|
self.start = True
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
@Update()
|
|
23
|
+
def play(self) -> pygame.Surface:
|
|
24
|
+
if self.start:
|
|
25
|
+
if pygame.time.get_ticks() - self.now >= self.frames_duration * 1000:
|
|
26
|
+
self.now = pygame.time.get_ticks()
|
|
27
|
+
self.index = (self.index + 1) % len(self.frames)
|
|
28
|
+
self.current_frame = self.frames[self.index]
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
self.now = pygame.time.get_ticks()
|
|
25
|
-
self.index = (self.index + 1) % len(self.frames)
|
|
26
|
-
self.current_frame = self.frames[self.index]
|
|
27
|
-
|
|
28
|
-
return self.current_frame
|
|
30
|
+
return self.current_frame
|
|
@@ -24,3 +24,11 @@ class JoystickManager:
|
|
|
24
24
|
@OnJoystick(axis=0, intensity=0.5)
|
|
25
25
|
def get_right(self):
|
|
26
26
|
return Direction.RIGHT
|
|
27
|
+
|
|
28
|
+
def get_direction(self):
|
|
29
|
+
for method in dir(self):
|
|
30
|
+
if method.startswith("get_"):
|
|
31
|
+
direction = getattr(self, method)()
|
|
32
|
+
if direction:
|
|
33
|
+
return direction
|
|
34
|
+
return None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PygameToolsKit
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.5
|
|
4
4
|
Summary: Bibliothèque qui dispose de divers classes, fonctions et décorateurs pour aider au développement avec pygame
|
|
5
5
|
Requires-Dist: DecoratorsToolKit>=1.0.0
|
|
6
6
|
Requires-Dist: pygame-ce>=2.5.0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
PygameToolsKit/__init__.py,sha256=Dp3KuXk3GqhiVEmJ2oYAwO54_duSsPDn7gOGcSMsXe4,199
|
|
2
|
-
PygameToolsKit/Animation/animation.py,sha256=
|
|
2
|
+
PygameToolsKit/Animation/animation.py,sha256=_aEpq_zuvEEI8VCBOaIyAkkhApyNWiF-S-xUxs87vmk,827
|
|
3
3
|
PygameToolsKit/Decorators/onJoystick.py,sha256=OSc6zQ18wGyP-S1OhCl9MVsn_ulNn-nY9JW5KiZBdL4,481
|
|
4
4
|
PygameToolsKit/Decorators/onKey.py,sha256=VGKMncOOouIs04eASofQ524mkqkgVmSSGF79LEz6K-A,396
|
|
5
5
|
PygameToolsKit/Decorators/timer.py,sha256=ETzIox027Ix0t2asjDDOu69RNba0-9X75U_CoCxUXrI,453
|
|
@@ -9,11 +9,11 @@ PygameToolsKit/Event/eventObject.py,sha256=3PosSVZIUvgGb8RsJSUZ8Se2bputAb9vzyQy-
|
|
|
9
9
|
PygameToolsKit/Event/isEventObject.py,sha256=bIPWAhwNwiQUWb6kYYHGhjmR1s8sDa1-CDH4xy7TW_s,558
|
|
10
10
|
PygameToolsKit/Graphics/color.py,sha256=TcKiyq7CnGHdEnAE3u17Fnrc6Mj5L1hh8p9Vt247Whg,424
|
|
11
11
|
PygameToolsKit/Inputs/dir.py,sha256=w8KDqO82T8DMnT45ZNHYbOvSFQ7lDVZLzJvs0jqbz8A,197
|
|
12
|
-
PygameToolsKit/Inputs/joystickManager.py,sha256=
|
|
12
|
+
PygameToolsKit/Inputs/joystickManager.py,sha256=OdegoO72DYByhrlUpC-3vm3X2Qw9vxnlJeIZApJB6Ls,808
|
|
13
13
|
PygameToolsKit/Inputs/keyManager.py,sha256=5CJlQvLv4zr_1sgPeiLGSR4afHcsoxMjUqjZjTX6mWU,540
|
|
14
14
|
PygameToolsKit/Update/update.py,sha256=xqXIZxqewDXjB0F1QcXrV2V8E_0ReE6LMNG9F3EkCPY,268
|
|
15
15
|
PygameToolsKit/Update/updateManager.py,sha256=Ae-HQmHa_-dL8lITEW6P9KKmH_xGCVG74UBILhiq1lM,416
|
|
16
|
-
pygametoolskit-1.2.
|
|
17
|
-
pygametoolskit-1.2.
|
|
18
|
-
pygametoolskit-1.2.
|
|
19
|
-
pygametoolskit-1.2.
|
|
16
|
+
pygametoolskit-1.2.5.dist-info/METADATA,sha256=gs0CL5f-GHq5NxQ84NLL2DoIOGAfdAoj5Ki8fHRJKvM,257
|
|
17
|
+
pygametoolskit-1.2.5.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
18
|
+
pygametoolskit-1.2.5.dist-info/top_level.txt,sha256=eJgRVhXT3DMSHVT7aoeiviyxfvIjKODNnYKm4OccqRw,15
|
|
19
|
+
pygametoolskit-1.2.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|