Mehr Logik
This commit is contained in:
1 parent
5e063d06b1
commit
3e32a54909
3 files changed
+37
-4
No files matched your search
@@ -1,4 +1,5 @@
|
||||
from spiel.cube_game import CubeGame
|
||||
|
||||
|
||||
|
||||
#source .venv/bin/activate
|
||||
if __name__ == "__main__":
|
||||
game = CubeGame()
|
||||
game.run()
|
||||
+1
-1
@@ -3,5 +3,5 @@ name = "wuerfel"
|
||||
version = "0.1.0"
|
||||
dependencies = ["pygame", "tabulate"]
|
||||
[project.optional-dependencies]
|
||||
dev = []
|
||||
dev = ["ruff"]
|
||||
|
||||
@@ -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))
|
||||
Reference in new issue
Block a user