PygameToolsKit 1.1.3__py3-none-any.whl → 1.2.4__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.
@@ -0,0 +1,30 @@
1
+ import pygame
2
+
3
+ from ..Update.update import Update
4
+
5
+ class Animation:
6
+
7
+ def __init__(self, frames: list[pygame.Surface], frame_duration: float):
8
+ self.frames = frames
9
+ self.now = pygame.time.get_ticks()
10
+
11
+ self.index = 0
12
+
13
+ self.current_frame = self.frames[self.index]
14
+
15
+ self.frames_duration = frame_duration
16
+
17
+ self.start = False
18
+
19
+ def start_animation(self):
20
+ self.start = True
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]
29
+
30
+ return self.current_frame
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PygameToolsKit
3
- Version: 1.1.3
3
+ Version: 1.2.4
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,4 +1,5 @@
1
1
  PygameToolsKit/__init__.py,sha256=Dp3KuXk3GqhiVEmJ2oYAwO54_duSsPDn7gOGcSMsXe4,199
2
+ PygameToolsKit/Animation/animation.py,sha256=_aEpq_zuvEEI8VCBOaIyAkkhApyNWiF-S-xUxs87vmk,827
2
3
  PygameToolsKit/Decorators/onJoystick.py,sha256=OSc6zQ18wGyP-S1OhCl9MVsn_ulNn-nY9JW5KiZBdL4,481
3
4
  PygameToolsKit/Decorators/onKey.py,sha256=VGKMncOOouIs04eASofQ524mkqkgVmSSGF79LEz6K-A,396
4
5
  PygameToolsKit/Decorators/timer.py,sha256=ETzIox027Ix0t2asjDDOu69RNba0-9X75U_CoCxUXrI,453
@@ -12,7 +13,7 @@ PygameToolsKit/Inputs/joystickManager.py,sha256=XTCKBawA1HW2AYMBACdA5tX125bIrtVv
12
13
  PygameToolsKit/Inputs/keyManager.py,sha256=5CJlQvLv4zr_1sgPeiLGSR4afHcsoxMjUqjZjTX6mWU,540
13
14
  PygameToolsKit/Update/update.py,sha256=xqXIZxqewDXjB0F1QcXrV2V8E_0ReE6LMNG9F3EkCPY,268
14
15
  PygameToolsKit/Update/updateManager.py,sha256=Ae-HQmHa_-dL8lITEW6P9KKmH_xGCVG74UBILhiq1lM,416
15
- pygametoolskit-1.1.3.dist-info/METADATA,sha256=sLES3bIuMdeZVNw5kcmlFgLIUfxKOOqwsDf4AYE3u1E,257
16
- pygametoolskit-1.1.3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
17
- pygametoolskit-1.1.3.dist-info/top_level.txt,sha256=eJgRVhXT3DMSHVT7aoeiviyxfvIjKODNnYKm4OccqRw,15
18
- pygametoolskit-1.1.3.dist-info/RECORD,,
16
+ pygametoolskit-1.2.4.dist-info/METADATA,sha256=A-CABFifsNdoleH2luWSxBIlTbOpEE5gVpFDEfwhUGM,257
17
+ pygametoolskit-1.2.4.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
18
+ pygametoolskit-1.2.4.dist-info/top_level.txt,sha256=eJgRVhXT3DMSHVT7aoeiviyxfvIjKODNnYKm4OccqRw,15
19
+ pygametoolskit-1.2.4.dist-info/RECORD,,