aboutsummaryrefslogtreecommitdiff
path: root/src/Ghost.py
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-04-19 02:09:53 +0200
committeromagdy7 <omar.professional8777@gmail.com>2023-04-19 02:09:53 +0200
commit6c43e3b3ab77ec0c3c57763178723a50e4dcac52 (patch)
treecbd4ce1a6ce900c1178c25f2dc6760e637aea71c /src/Ghost.py
parent5cb37cd7aac7fab72b04061de6dfd5f2f5f254fa (diff)
downloadMacpan-6c43e3b3ab77ec0c3c57763178723a50e4dcac52.tar.xz
Macpan-6c43e3b3ab77ec0c3c57763178723a50e4dcac52.zip
Added the ghost sprites to the game.
Diffstat (limited to 'src/Ghost.py')
-rw-r--r--src/Ghost.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Ghost.py b/src/Ghost.py
index 17f5ed0..a26de62 100644
--- a/src/Ghost.py
+++ b/src/Ghost.py
@@ -1,12 +1,14 @@
import pygame
import math
+from util import get_sprites
from Direction import DIRECTION
import map as Map
class Ghost():
- def __init__(self, color, x, y):
+ def __init__(self,sprite_sheet, color, x, y):
self.x = x
self.y = y
+ self.sprite = get_sprites(sprite_sheet)
self.color = color
self.last_move = 3
self.speed = 3
@@ -82,7 +84,5 @@ class Ghost():
def draw(self, screen):
radius = 30 // 2
- pos = (self.x , self.y)
- pygame.draw.circle(screen, self.color, pos, radius)
-
-
+ pos = (self.x - radius , self.y - radius)
+ screen.blit(self.sprite[0], pos)