Projekt_Si/classes/coffeMachine.py

20 lines
688 B
Python

from classes.interactable import Interactable
import pygame
import prefs
from classes.agent import Agent
class CoffeMachine(Interactable):
def __init__(self, cell, name, sprite="sprites/CoffeeVendingMachine2.png"):
super().__init__(cell, sprite)
self.sprite = pygame.image.load(sprite).convert_alpha()
self.sprite = pygame.transform.scale(self.sprite, (prefs.CELL_SIZE, prefs.CELL_SIZE))
self.name = name
def interact(self,agent):
if not isinstance(agent, Agent):
print("Agent must be of type Agent")
return
agent.increase_multiplier(1)
print("Agent interacted with {}".format(self.name))