Skip to content

Commit

Permalink
Add support for python38
Browse files Browse the repository at this point in the history
  • Loading branch information
chyok committed May 17, 2024
1 parent 90a4369 commit f5e0279
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 75 deletions.
66 changes: 0 additions & 66 deletions poetry.lock

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
packages = [{include = "ten_drops"}]

[tool.poetry.dependencies]
python = "^3.11"
python = "^3.7"
pygame-ce = "^2.4.1"


Expand Down
11 changes: 5 additions & 6 deletions ten_drops/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pygame

from pygame.mixer import SoundType

from typing import List
from os.path import join, dirname
from dataclasses import dataclass

Expand Down Expand Up @@ -51,8 +50,8 @@

@dataclass
class Status:
action: list[Surface]
change_action: list[Surface]
action: List[Surface]
change_action: List[Surface]
static: Surface | None = None


Expand All @@ -66,7 +65,7 @@ def play(self):
self.sound.play()


def get_drop_images() -> list[Status]:
def get_drop_images() -> List[Status]:
drop_image_path = join(ImageFolderPath, "drop")
drop_image_paths = [join(drop_image_path, f"{i}.png") for i in range(134)]

Expand All @@ -85,7 +84,7 @@ def get_drop_images() -> list[Status]:
Status(action=drop_images[115:130], change_action=drop_images[130:134], static=drop_images[126])]


def get_droplet_images() -> list[Status]:
def get_droplet_images() -> List[Status]:
droplet_image_path = join(ImageFolderPath, "droplet")
droplet_image_paths = [join(droplet_image_path, f"{i}.png") for i in range(7)]

Expand Down
4 changes: 3 additions & 1 deletion ten_drops/droplet.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import List

from pygame.sprite import Sprite
from pygame.transform import rotate

Expand Down Expand Up @@ -53,7 +55,7 @@ def update(self):
self._update_image(DROPLET_IMAGES[0].static)

@classmethod
def diffusion(cls, row, col, *group) -> list["Droplet"]:
def diffusion(cls, row, col, *group) -> List["Droplet"]:
BREAK_SOUND.play()
droplets = []
for direction in [Direction.Down, Direction.Up, Direction.Left, Direction.Right]:
Expand Down
3 changes: 2 additions & 1 deletion ten_drops/notification.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pygame

from typing import Dict
from collections import namedtuple

from pygame import Surface, Font
Expand All @@ -20,7 +21,7 @@ class NoticeType:
text_font = Font(TEXT_FONT_PATH, size=16)
text_font.set_bold(True)

TextDict: dict[str, _NType] = {
TextDict: Dict[str, _NType] = {
NoticeType.about: _NType("about", text_font, Color("white")),
NoticeType.failed: _NType("failed", Font(FONT_PATH, size=45), Color("white")),
NoticeType.success: _NType("failed", Font(FONT_PATH, size=45), Color("white"))
Expand Down

0 comments on commit f5e0279

Please sign in to comment.