npc interaction

No problem.

Eli

This is pretty interesting. I’m going to be working on npc dialog soon and I think I will hard code it. I don’t think that’s going to be that much of a problem as long as it’s easy to find and change things. I’m thinking of using an npc class with an abstract method called talk() or something and then write extended classes for each character with the dialog and actions taken. Since classes are alphabetic in my IDE, I can just use a prefix to get them to all group together. This will be for a small game, however.
I’ve already come across this with things like “attack” that have to be so different from character to character that the object oriented method really seems to work the best.

how small?

I was going to hardcode, but then realized it would take a lot!

but my game I dont have a limit to how far I am going ;).

update:

I have gotten the npc to move around give money gold items exp …

I also have a shop, it can move you to another area, so missions exist. I am jsut moving a long quite nicely!

[quote]how small?
[/quote]
It will be an applet game, so pretty small. I’m not sure how many npc’s but I don’t think it will be a problem. Aside from class names, I don’t see how it adds much. I’ll just use a “Z” prefix so all the characters are always last in the class list.

Surely a much less ugly approach would be to put them in their own package (or sub package)?

I guess that would look a little better. ;D I haven’t done much java programming. This is my second game.

npc in second game?

well good luck.

It’s my second java game. I’ve written a few adventure games, but with a special engine called Wintermute.

You can see what I’ve done so far here:
http://fireside7games.com/labz/strat_test1.html

It’s got some bugs, but the move and attack buttons sort of work, at least some of the time. ;D It will be turn based. I’m using Jpct.

Well your game looks pretty cool so far. Lots of bugs like you said but overall pretty nifty.

Thanks.

That also allows you to filter it in code completion in al major IDE’s.