From 3e32a549090d61dc27b5617b5cd3b496e0c54bc7 Mon Sep 17 00:00:00 2001 From: Lena Date: Wed, 28 Oct 2026 23:55:35 +0100 Subject: [PATCH] Mehr Logik --- main.py | 7 ++++--- pyproject.toml | 2 +- spiel/cube_game.py | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index b97c6f2..3e0d22b 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ +from spiel.cube_game import CubeGame - - -#source .venv/bin/activate \ No newline at end of file +if __name__ == "__main__": + game = CubeGame() + game.run() diff --git a/pyproject.toml b/pyproject.toml index 84298ef..a7355f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,5 +3,5 @@ name = "wuerfel" version = "0.1.0" dependencies = ["pygame", "tabulate"] [project.optional-dependencies] -dev = [] +dev = ["ruff"] diff --git a/spiel/cube_game.py b/spiel/cube_game.py index e69de29..c79c06e 100644 --- a/spiel/cube_game.py +++ b/spiel/cube_game.py @@ -0,0 +1,32 @@ +from spiel.game import Game + +class CubeGame(Game): + """A simple 3D cube game demo.""" + + def __init__(self): + super().__init__("3D Cube", 60, (640, 480)) + self.corners = [[-1, -1, -1], [ 1, -1, -1], [ 1, 1, -1], [-1, 1, -1],[-1, -1, 1], [ 1, -1, 1], [ 1, 1, 1], [-1, 1, 1]] + self.angle_x = 0 + self.angle_y = 0 + self.edges = [ + (0, 1), + (1, 2), + (2, 3), + (3, 0), + (4, 5), + (5, 6), + (6, 7), + (7, 4), + (0, 4), + (1, 5), + (2, 6), + (3, 7), + ] + + def update_game(self) -> bool: + # No logic yet, just keep running + return True + + def draw_game(self) -> None: + # Clear screen to black + self.screen.fill((0, 0, 0))