hypatia-software-org / hypatia-engine

Hypatia Engine: make 2D action adventure games. For programmers and nonprogrammers alike.
http://engine.hypatiasoftware.org/
MIT License
281 stars 22 forks source link

Implement usable_once flag #59

Open kawa-kokosowa opened 9 years ago

kawa-kokosowa commented 9 years ago

Create usable_once property for NPCs in NPC.ini and tmx whereas an NPC is destroyed after it is "used." A problem I see is what constitutes "used?"

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ejmr commented 8 years ago

There will probably be multiple useful definitions of "used" in this context. One I can think of is that we can consider an NPC "used" once it reaches a certain position, i.e. its X-Y coordinates equal certain values in the configuration which mean, "When the NPC gets to here, the game can remove it."

kawa-kokosowa commented 8 years ago

yeah and I'm not sure how I wanna pull of "activation" for like... instead of talking to a door, which spacebar is by default, you would just... open it and it'd be destroyed.

ejmr commented 8 years ago

On that note, what exactly is the purpose of the after_activate=destroy setting for the door in the NPC.ini file in the demo?

kawa-kokosowa commented 8 years ago

Dragon Warrior (Game Boy Color) style door interaction.

ejmr commented 8 years ago

Talk about nostalgia. Dragon Warrior on the NES was the first RPG I ever played, heh.

ejmr commented 8 years ago

See commit bcd9745092751e855c29614bd4521e3ce5d8ac26 for an example of how these changes can be used to create an NPC representing a door which we could destroy (or do whatever else) based on its active status.

ejmr commented 8 years ago

2d406f71675764095fc08895ce958811dec67eb0 fails on Travis-CI due to a PEP8 style error in hypatia/player.py. However, running the test suite locally does not produce this error, i.e. the file passes PEP8 cleanly. Not sure what the cause may be---difference in configuration between Travis-CI and our local test.sh?

kawa-kokosowa commented 8 years ago

I'll try looking it up in a bit. :) I'll have to review the changes.