summaryrefslogtreecommitdiff
path: root/src/sliceitoff/__main__.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-16 22:05:05 +0200
committerViljami Ilola <+@hix.fi>2024-03-16 22:05:05 +0200
commit4050057c34c67130cf5f1d202ca85cb81985f968 (patch)
tree93dfd6b3eaa4e8cb153266326724afb07d141dcf /src/sliceitoff/__main__.py
parent2fd254af8613dba6bbd7bd9f52514229a5287d21 (diff)
make it installable
Diffstat (limited to 'src/sliceitoff/__main__.py')
-rw-r--r--src/sliceitoff/__main__.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/sliceitoff/__main__.py b/src/sliceitoff/__main__.py
new file mode 100644
index 0000000..347d78e
--- /dev/null
+++ b/src/sliceitoff/__main__.py
@@ -0,0 +1,49 @@
+""" Slice It Off! - Game where you slice the area where enemies reside to
+ the minimum
+"""
+
+from time import sleep
+from pathlib import Path
+
+import pygame
+
+from display import Display
+from status import Status
+from player import Player
+from field import Field
+from enemies import Enemies
+from images import Images
+from game import Game
+
+
+def sliceitoff():
+ """ The game - It all starts here """
+ pygame.init()
+
+ display = Display()
+ Images.load_images( Path(__file__).parent.resolve() )
+
+ status = Status()
+ field = Field()
+ enemies = Enemies(field = field, level = 2)
+ player = Player(field = field, enemies = enemies)
+ game = Game(player = player)
+
+ clock = pygame.time.Clock()
+
+ for _ in range(6000):
+ if game.step():
+ break
+ display.update(
+ [
+ status.get_sprites(),
+ field.get_sprites(),
+ enemies.get_sprites(),
+ player.get_sprites()
+ ])
+ clock.tick(60)
+
+ sleep(2)
+ pygame.quit()
+
+sliceitoff()