PygameToolsKit 1.2.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.
@@ -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
- def play(self) -> pygame.Surface | None:
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
- if pygame.time.get_ticks() - self.now >= self.frames_duration * 1000:
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PygameToolsKit
3
- Version: 1.2.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,5 +1,5 @@
1
1
  PygameToolsKit/__init__.py,sha256=Dp3KuXk3GqhiVEmJ2oYAwO54_duSsPDn7gOGcSMsXe4,199
2
- PygameToolsKit/Animation/animation.py,sha256=0tA02TK-DY2jbZj7034I0f4QpzDlWAEOPrX-azM8050,749
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
@@ -13,7 +13,7 @@ PygameToolsKit/Inputs/joystickManager.py,sha256=XTCKBawA1HW2AYMBACdA5tX125bIrtVv
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.3.dist-info/METADATA,sha256=Q1I3MBaMbLFg2Rpz2ZXpGTfFugOpOZ5AdQNSFce7NHs,257
17
- pygametoolskit-1.2.3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
18
- pygametoolskit-1.2.3.dist-info/top_level.txt,sha256=eJgRVhXT3DMSHVT7aoeiviyxfvIjKODNnYKm4OccqRw,15
19
- pygametoolskit-1.2.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,,