]> Untitled Git - axy/ft/pacman.git/commitdiff
Type checker cleanup
author= <=>
Mon, 5 Oct 2026 11:45:55 +0000 (13:45 +0200)
committer= <=>
Mon, 5 Oct 2026 11:45:55 +0000 (13:45 +0200)
src/pacman/ecs/world.py
src/pacman/game/__init__.py

index 8e4eed08fd0db1c9bafa1e9fda33650dc7638944..2fcfeac639266d9a7d0b8d9aedb8fcfe06604731 100644 (file)
@@ -652,7 +652,7 @@ class Resource(FromWorld, Component):
 
         def default() -> Self | None:
             if (val := def_cb()) is None:
-                return
+                return None
             world.spawn(cast(type[Self], ty), val)
             return val
 
index 5d5c425f35b476d4458aa1697ba4ba382f2acfc0..7c0cc3ecbfdaa1c3cb2f4af522cbae3324a08b75 100644 (file)
@@ -3,8 +3,8 @@ from dataclasses import dataclass
 from enum import Enum, auto
 from random import random
 
-from mazegenerator import MazeGenerator
-from pygame import K_a, K_d, K_s, K_w, Vector2, Vector3
+from mazegenerator import MazeGenerator  # type: ignore[import-untyped]
+from pygame import K_a, K_d, K_s, K_w, Vector2
 from pygame.math import clamp
 
 from pacman.ecs import minimal_plugins
@@ -65,11 +65,11 @@ def create_maze(
             tuple[Maze, Coord2D, CoordAbs2D],
             (root_maze, Coord2D(), CoordAbs2D()),
         )
-        cell_dims = Vector3(64, 64, 0)
+        cell_dims = Coord2D(64, 64, 0)
         cells = {
             (x, y): (
                 ChildOf(root),
-                Coord2D(cell_dims.elementwise() * Vector3(x, y, 0)),
+                Coord2D(Coord2D(x, y, 0).elementwise() * cell_dims),
                 Cell(cell, (x, y)),
                 ShouldRender(),
                 CoordAbs2D(),
@@ -248,6 +248,7 @@ class Inputs(Resource):
             return 2
         if K_a in self.inputs:
             return 3
+        return None
 
 
 @dataclass
@@ -361,7 +362,8 @@ def spawn_ghosts(
                     [
                         [
                             assets.load(
-                                f"./asset/enemy/ghost{variant.name}_{direction}.png"
+                                "./asset/enemy/ghost"
+                                + f"{variant.name}_{direction}.png"
                             )
                         ]
                         for direction in "URDL"