-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
1,084 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
# Python environment | ||
venv | ||
__pycache__ | ||
*.pyc | ||
other | ||
|
||
# Android | ||
bin | ||
.buildozer | ||
|
||
# Test data | ||
.coverage | ||
.cProfile | ||
|
||
# Build and other | ||
build | ||
dist | ||
*.egg-info | ||
.coverage | ||
bin | ||
.buildozer | ||
other |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pygame==2.0.3 | ||
packaging==20.4 | ||
requests==2.24.0 | ||
platformdirs==2.1.0 | ||
pygame==2.1.2 | ||
packaging>=20.4 | ||
requests>=2.24.0 | ||
platformdirs>=2.1.0 | ||
psutil>=5.5.1 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+15.6 KB
...ay/assets/images/buttons/effects_true.bmp → spaceway/assets/images/buttons/effects_0.bmp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+15.6 KB
...assets/images/buttons/difficulty_hard.bmp → spaceway/assets/images/buttons/music_0.bmp
Binary file not shown.
Binary file renamed
BIN
+15.6 KB
...assets/images/buttons/difficulty_easy.bmp → spaceway/assets/images/buttons/music_100.bmp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
""" File with implementation of various utility functions """ | ||
|
||
from functools import lru_cache | ||
|
||
import pygame | ||
|
||
|
||
@lru_cache(maxsize=4) | ||
def _circle_points(r): | ||
"""Descretization of a circle into a list of points | ||
Args: | ||
r (int): Circle radius | ||
Returns: | ||
List[Tuple[int, int]]: List of points representing a circle with | ||
given radius | ||
""" | ||
x, y, e = r, 0, 1 - r | ||
|
||
points = [] | ||
|
||
while x >= y: | ||
points.append((x, y)) | ||
|
||
y += 1 | ||
if e < 0: | ||
e += 2 * y - 1 | ||
else: | ||
x -= 1 | ||
e += 2 * (y - x) - 1 | ||
|
||
points += [(y, x) for x, y in points if x > y] | ||
points += [(-x, y) for x, y in points if x] | ||
points += [(x, -y) for x, y in points if y] | ||
|
||
return points | ||
|
||
|
||
def render(font, text, color, border=0, bcolor=None): | ||
"""Analog of the :method:`pygame.font.Font.render` with support of a | ||
border around the font | ||
Args: | ||
font (pygame.font.Font): Font object | ||
text (str): The text you need to render | ||
color (pygame.Color): Text color | ||
border (int): Border width | ||
bcolor (pygame.Color): Border color | ||
Returns: | ||
pygame.Surface: Rendered text | ||
""" | ||
text_surface = font.render(text, True, color).convert_alpha() | ||
w = text_surface.get_width() + 2 * border | ||
h = font.get_height() + 2 * border | ||
|
||
osurf = pygame.Surface((w, h)).convert_alpha() | ||
osurf.fill((0, 0, 0, 0)) | ||
|
||
surf = osurf.copy() | ||
|
||
osurf.blit(font.render(text, True, bcolor).convert_alpha(), (0, 0)) | ||
|
||
for dx, dy in _circle_points(border): | ||
surf.blit(osurf, (dx + border, dy + border)) | ||
|
||
surf.blit(text_surface, (border, border)) | ||
|
||
return surf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"nick": "your nick here", | ||
"effects": true, | ||
"effects": 1, | ||
"music": 1, | ||
"full_screen": false, | ||
"updates": true, | ||
"difficulty": 0, | ||
"color": 0 | ||
} |
Oops, something went wrong.