Saturday, July 30, 2011

Combat!

It's sunny outside today, so naturally I spent most of the day in doors. :D

Combat now works. At least, the player is able to attack NPCs. The NPCs can't attack back yet. But, when they die, they can drop loot, which is pretty cool.

The command for attacking follows this example "Attack NPC with ITEM". It took me a while to figure out how to separate all the words into different variables, but a couple find methods and trim functions later and it was working.

I then rewrote it all to make combat more NPC friendly. As I said, NPCs can't yet attack back, but when I get to that, I should be able to reuse a good chunk of code.

-Dash27

No comments:

Post a Comment