From 6c43e3b3ab77ec0c3c57763178723a50e4dcac52 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Wed, 19 Apr 2023 02:09:53 +0200 Subject: Added the ghost sprites to the game. --- src/Ghost.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Ghost.py') 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) -- cgit v1.2.3