22 lines
529 B
Python
22 lines
529 B
Python
from observable import Observable
|
|
from collections import defaultdict
|
|
|
|
import logging
|
|
import time
|
|
|
|
class Target(Observable):
|
|
|
|
lastActivation = 0
|
|
|
|
def __init__(self, points, name):
|
|
logging.info("Target " + name + " created")
|
|
self._events = defaultdict(list)
|
|
self.points = points
|
|
self.name = name
|
|
self.hit_key = "hit"
|
|
|
|
def hit(self):
|
|
#notify Observers
|
|
#notify Gamestate
|
|
logging.info("Target " + self.name + " hit")
|
|
self.trigger(self.hit_key, self) |