crystalwindow 4.5__py3-none-any.whl → 4.7__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.
- crystalwindow/FileHelper.py +159 -38
- crystalwindow/Icons/file_icons.png +0 -0
- crystalwindow/__init__.py +19 -24
- crystalwindow/assets.py +250 -59
- crystalwindow/clock.py +137 -13
- crystalwindow/color_handler.py +3 -21
- crystalwindow/crystal3d.py +135 -56
- crystalwindow/fun_helpers.py +4 -0
- crystalwindow/gametests/3dsquare.py +2 -2
- crystalwindow/gametests/gravitytest.py +96 -23
- crystalwindow/gametests/guitesting.py +4 -2
- crystalwindow/gametests/squaremove.py +4 -1
- crystalwindow/gametests/testtttagain.py +17 -0
- crystalwindow/gui.py +87 -17
- crystalwindow/gui_ext.py +51 -39
- crystalwindow/objects.py +171 -0
- crystalwindow/sprites.py +174 -25
- crystalwindow/tilemap.py +1 -1
- crystalwindow/websearch.py +91 -165
- crystalwindow/window.py +430 -12
- {crystalwindow-4.5.dist-info → crystalwindow-4.7.dist-info}/METADATA +6 -2
- crystalwindow-4.7.dist-info/RECORD +43 -0
- crystalwindow/cw_client.py +0 -95
- crystalwindow/player.py +0 -106
- crystalwindow-4.5.dist-info/RECORD +0 -42
- {crystalwindow-4.5.dist-info → crystalwindow-4.7.dist-info}/WHEEL +0 -0
- {crystalwindow-4.5.dist-info → crystalwindow-4.7.dist-info}/licenses/LICENSE +0 -0
- {crystalwindow-4.5.dist-info → crystalwindow-4.7.dist-info}/top_level.txt +0 -0
crystalwindow/player.py
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import math, os, re
|
|
2
|
-
from .assets import load_folder_images
|
|
3
|
-
from .animation import Animation
|
|
4
|
-
|
|
5
|
-
class Player:
|
|
6
|
-
def __init__(self, pos=(0, 0), speed=5, size=(32, 32)):
|
|
7
|
-
self.x, self.y = pos
|
|
8
|
-
self.speed = speed
|
|
9
|
-
self.width, self.height = size
|
|
10
|
-
self.animations = {}
|
|
11
|
-
self.current_anim = None
|
|
12
|
-
self.image = None
|
|
13
|
-
self.rect = self._make_rect()
|
|
14
|
-
|
|
15
|
-
# make a lil rect obj for collisions
|
|
16
|
-
def _make_rect(self):
|
|
17
|
-
return type("Rect", (), {"x": self.x, "y": self.y, "w": self.width, "h": self.height,
|
|
18
|
-
"topleft": (self.x, self.y)})()
|
|
19
|
-
|
|
20
|
-
# === animation setup ===
|
|
21
|
-
def idle(self, folder):
|
|
22
|
-
imgs = self._load_sorted(folder)
|
|
23
|
-
anim = Animation(imgs)
|
|
24
|
-
self.animations["idle"] = anim
|
|
25
|
-
self.current_anim = anim
|
|
26
|
-
return anim
|
|
27
|
-
|
|
28
|
-
class walk:
|
|
29
|
-
@staticmethod
|
|
30
|
-
def cycle(folder):
|
|
31
|
-
imgs = Player._load_sorted_static(folder)
|
|
32
|
-
anim = Animation(imgs)
|
|
33
|
-
anim.loop = True
|
|
34
|
-
return anim
|
|
35
|
-
|
|
36
|
-
@staticmethod
|
|
37
|
-
def once(folder):
|
|
38
|
-
imgs = Player._load_sorted_static(folder)
|
|
39
|
-
anim = Animation(imgs)
|
|
40
|
-
anim.loop = False
|
|
41
|
-
return anim
|
|
42
|
-
|
|
43
|
-
class jump:
|
|
44
|
-
@staticmethod
|
|
45
|
-
def cycle(folder):
|
|
46
|
-
imgs = Player._load_sorted_static(folder)
|
|
47
|
-
anim = Animation(imgs)
|
|
48
|
-
anim.loop = True
|
|
49
|
-
return anim
|
|
50
|
-
|
|
51
|
-
@staticmethod
|
|
52
|
-
def once(folder):
|
|
53
|
-
imgs = Player._load_sorted_static(folder)
|
|
54
|
-
anim = Animation(imgs)
|
|
55
|
-
anim.loop = False
|
|
56
|
-
return anim
|
|
57
|
-
|
|
58
|
-
# === main update ===
|
|
59
|
-
def update(self, dt, win):
|
|
60
|
-
moving = False
|
|
61
|
-
if win.is_key_pressed("left"):
|
|
62
|
-
self.x -= self.speed * dt * 60
|
|
63
|
-
moving = True
|
|
64
|
-
if win.is_key_pressed("right"):
|
|
65
|
-
self.x += self.speed * dt * 60
|
|
66
|
-
moving = True
|
|
67
|
-
if win.is_key_pressed("up"):
|
|
68
|
-
self.y -= self.speed * dt * 60
|
|
69
|
-
moving = True
|
|
70
|
-
if win.is_key_pressed("down"):
|
|
71
|
-
self.y += self.speed * dt * 60
|
|
72
|
-
moving = True
|
|
73
|
-
|
|
74
|
-
# update animation
|
|
75
|
-
if moving and "run" in self.animations:
|
|
76
|
-
self.current_anim = self.animations["run"]
|
|
77
|
-
elif not moving and "idle" in self.animations:
|
|
78
|
-
self.current_anim = self.animations["idle"]
|
|
79
|
-
|
|
80
|
-
if self.current_anim:
|
|
81
|
-
self.current_anim.update(dt)
|
|
82
|
-
self.image = self.current_anim.get_frame()
|
|
83
|
-
|
|
84
|
-
self.rect.x, self.rect.y = self.x, self.y
|
|
85
|
-
self.rect.topleft = (self.x, self.y)
|
|
86
|
-
|
|
87
|
-
def draw(self, win):
|
|
88
|
-
if self.image:
|
|
89
|
-
win.screen.blit(self.image, (self.x, self.y))
|
|
90
|
-
|
|
91
|
-
# ---------- helpers ----------
|
|
92
|
-
def _load_sorted(self, folder):
|
|
93
|
-
imgs_dict = load_folder_images(folder)
|
|
94
|
-
return self._sort_images(imgs_dict)
|
|
95
|
-
|
|
96
|
-
@staticmethod
|
|
97
|
-
def _load_sorted_static(folder):
|
|
98
|
-
imgs_dict = load_folder_images(folder)
|
|
99
|
-
return Player._sort_images(imgs_dict)
|
|
100
|
-
|
|
101
|
-
@staticmethod
|
|
102
|
-
def _sort_images(imgs_dict):
|
|
103
|
-
def extract_num(filename):
|
|
104
|
-
match = re.search(r'(\d+)', filename)
|
|
105
|
-
return int(match.group(1)) if match else 0
|
|
106
|
-
return [img for name, img in sorted(imgs_dict.items(), key=lambda x: extract_num(x[0]))]
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
crystalwindow/FileHelper.py,sha256=aUnnRG7UwvzJt-idjWjmpwy3RM6nqLlC3-7Bae6Yb94,5471
|
|
2
|
-
crystalwindow/__init__.py,sha256=nOEUvoB4OpcYq_le1Kee0Uef3Jq38bYYapOI1u1CN2E,2457
|
|
3
|
-
crystalwindow/ai.py,sha256=YIt6dNe1QljSAlNECCVa3DMUSIqQEJRIAAbQpYqFNNo,11525
|
|
4
|
-
crystalwindow/animation.py,sha256=zHjrdBXQeyNaLAuaGPldJueX05OZ5j31YR8NizmR0uQ,427
|
|
5
|
-
crystalwindow/assets.py,sha256=2Cj0zdhMWo3mWjdr9KU5n-9_8iKj_fJ9uShMFA-27HU,5193
|
|
6
|
-
crystalwindow/camera.py,sha256=tbn4X-jxMIszAUg3Iu-89gJN5nij0mjPMEzGotcLbJI,712
|
|
7
|
-
crystalwindow/clock.py,sha256=EAcNvxonD7ktkKSIbuVHqzhPhQqtUQtleMSBB_OuUQY,541
|
|
8
|
-
crystalwindow/collision.py,sha256=hpkHTp_KparghVK-itp_rxuYdd2GbQMxICHlUBv0rSw,472
|
|
9
|
-
crystalwindow/color_handler.py,sha256=ZnXnz8552GPiRAnCkW_8wycwRRMAaFRFLlCcsrv0j2E,4071
|
|
10
|
-
crystalwindow/crystal3d.py,sha256=-Te9IJgbtzl8Mpuc4BPi2bn2apnvBNTI2GwxSLd8sqg,2006
|
|
11
|
-
crystalwindow/cw_client.py,sha256=KxhvXtsTfrCupB2zi5e35ppKVPrOkVXTuhgCNT6V2eA,3264
|
|
12
|
-
crystalwindow/draw_helpers.py,sha256=HqjI5fTbdnA55g4LKYEuMUdIjrWaBm2U8RmeUXjcQGw,821
|
|
13
|
-
crystalwindow/draw_rects.py,sha256=o7siET3y35N2LPeNBGe8QhsQbOH8J-xF6fOUz07rymU,1484
|
|
14
|
-
crystalwindow/draw_text_helper.py,sha256=qv5fFCuTCKWeGDk9Z_ZpOzrTFP8YYwlgQrrorwrq9Hg,1298
|
|
15
|
-
crystalwindow/draw_tool.py,sha256=1YYEqjmgt4HpV3S15sTjCSmcqgHup4fD8gskTkxU0t4,1638
|
|
16
|
-
crystalwindow/fun_helpers.py,sha256=fo5yTwGENltdtVIVwgITtUkvzpsImujOcqTxe8XPzR8,760
|
|
17
|
-
crystalwindow/gravity.py,sha256=pZJykZzO-mKVBPsZRP55nnlvUoYQfR29wPgJcI4IbBs,2904
|
|
18
|
-
crystalwindow/gui.py,sha256=vqI2Qpus0RHEwEsef0gojXb54yOFo6p-9TnDF4bEnSg,3538
|
|
19
|
-
crystalwindow/gui_ext.py,sha256=aOZ5Fa0VoBJd3SiEW2zgH2Sw1NwnK2mW1YtGdJijDVg,3045
|
|
20
|
-
crystalwindow/math.py,sha256=slOY3KQZ99VDMUMxsSJabMyRtJcwVzEyxR2RoXspHho,963
|
|
21
|
-
crystalwindow/player.py,sha256=4wpIdUZLTlRXV8fDRQ11yVJRbx_cv8Ekpn2y7pQGgAQ,3442
|
|
22
|
-
crystalwindow/sprites.py,sha256=2kYW4QfSnyUwRLedZCkb99wUSxn2a0JdWOHcfkxcG0U,3411
|
|
23
|
-
crystalwindow/tilemap.py,sha256=PHoKL1eWuNeHIf0w-Jh5MGdQGEgklVsxqqJOS-GNMKI,322
|
|
24
|
-
crystalwindow/ver_warner.py,sha256=qEN3ulc1NixBy15FFx2R3Zu0DhyJTVJwiESGAPwpynM,3373
|
|
25
|
-
crystalwindow/websearch.py,sha256=O98LfYPuovdU6ct8iStNpoEJLTc26av9bz4nqX6lyN4,8027
|
|
26
|
-
crystalwindow/window.py,sha256=umJ8gNGS64N_mVzPBBxZKUNq0mDcGoy7ImJthLlZHSI,18337
|
|
27
|
-
crystalwindow/Icons/default_icon.png,sha256=Loq27Pxb8Wb3Sz-XwtNF1RmlLNxR4TcfOWfK-1lWcII,7724
|
|
28
|
-
crystalwindow/docs/getting_started.md,sha256=e_XEhJk8eatS22MX0nRX7hQNkYkwN9both1ObabZSTw,5759
|
|
29
|
-
crystalwindow/docs/index.md,sha256=bd14uLWtRSeRBm28zngGyfGDI1J6bJRvHkQLDpYwgOE,747
|
|
30
|
-
crystalwindow/gametests/3dsquare.py,sha256=gZ9qUiF3tkxJOXtnliB2xSJbpIGJxolgA2vi9nRrr-Q,811
|
|
31
|
-
crystalwindow/gametests/__init__.py,sha256=TRwhDl8aO3Wdqu_DXi9qT35CqF86AIyLqOSAkjNMJFY,240
|
|
32
|
-
crystalwindow/gametests/__main__.py,sha256=93R7DXHRK7GPsMrZB526pkWCrKJ728E1G4wCbHk3kP0,751
|
|
33
|
-
crystalwindow/gametests/gravitytest.py,sha256=mMqOkjJTbpa_XgHHBSIcVt9zfE8yW6rd7KuKgANS7Gc,1264
|
|
34
|
-
crystalwindow/gametests/guitesting.py,sha256=SrOssY5peCQEV6TQ1AiOWtjb9phVGdRzW-QzIl_MX5Q,1920
|
|
35
|
-
crystalwindow/gametests/sandbox.py,sha256=Oo2tU2N0y3BPVa6T5vs_h9N6islhQrjSrr_78XLut5I,1007
|
|
36
|
-
crystalwindow/gametests/squaremove.py,sha256=poP2Zjl2oc2HVvIAgIK34H2jVj6otL4jEdvAOR6L9sI,572
|
|
37
|
-
crystalwindow/gametests/windowtesting.py,sha256=_9X6wnV1-_X_PtNS-0zu-k209NtFIwAc4vpxLPp7V2o,97
|
|
38
|
-
crystalwindow-4.5.dist-info/licenses/LICENSE,sha256=Gt5cJRchdNt0guxyQMHKsATN5PM5mjuDhdO6Gzs9qQc,1096
|
|
39
|
-
crystalwindow-4.5.dist-info/METADATA,sha256=nWirrrZxkZMaUYGi8BbZQ3fGFCh0d0OZTtLReJHzYls,7338
|
|
40
|
-
crystalwindow-4.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
41
|
-
crystalwindow-4.5.dist-info/top_level.txt,sha256=PeQSld4b19XWT-zvbYkvE2Xg8sakIMbDzSzSdOSRN8o,14
|
|
42
|
-
crystalwindow-4.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|