Original Post
Hi there,
I'm working on a Java game (like everyone here
) and I have thoguht up something. In my game (RPG-alike) there will be alot of items, weapons, etc. (almost) Every item can be used, alone or with other items.
If you use an item, probaly a couple of functions will be called, like this:
giveExp(100);
decreaseHP(2);
...
You get the picture. Because alot of items will be used, I was think, should I make a scripting system, rather than some kind of large switch statement(this would make my code hard to read and edit) Every script could be put into a file, so it's easy to edit and to add.
To use a class for every item would probally be an overkill, since there will be alot of items.
My question is, should I do it like that? Are there any other ways?
Oh the game will be client/server type, so the use of plain text files containing the script isn't an issue
Thank you in advance!
Wesley
[edited by - wicked_wesley on January 27, 2004 4:51:38 PM]