Spaces:
Running
Running
File size: 267 Bytes
fdcbf65 |
1 2 3 4 5 6 7 8 9 10 11 12 |
# Create NPCs with simple AI behaviors.
class NPC:
def __init__(self, name):
self.name = name
self.health = 100
def decide_action(self, player):
if self.health < 30:
return "flee"
else:
return "attack"
|