Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Prgrmmer
/
ai-dungeon
like
0
Running
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
b4433a3
ai-dungeon
/
game
/
npc.py
prgrmc
First commit project
fdcbf65
about 1 month ago
raw
Copy download link
history
blame
Safe
267 Bytes
# 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"