Sign in to follow this  
Molarmite

Doing HP, Money, Exp in RPG games

Recommended Posts

How do you get all of those things above to increase or decrease depending on where you go? I already got a database with all those created, now I need to make like a hospital where HP goes up, a store where Money goes down, etc. Can anyone help me out with this? I'm making a browser-based RPG using PHP/MySQL. [Edited by - Molarmite on May 8, 2007 9:28:06 PM]

Share this post


Link to post
Share on other sites
psuedosql:

Run every 'tick' (or depending on the design, run when your browser leaves the hospital and adding a time multiplier to the effect):


if character.locale in (locales with hospitals) and character.hp < character.maxhp then character.hp += hospital.heal_rate;

if character.hp > character.maxhp then character.hp = character.maxhp;


Something akin to this I'd imagine at least. Clear? Not clear? Care to explain more of your design and ideas of how to do it, but why those don't work?

Share this post


Link to post
Share on other sites
I can't get to these forums at work (where I spend most of my online time), but I've gotten a PHP/MySQL game up and running to teach myself.

There are a number of different ways to handle your question, and they depend a lot of what type of game you are running.

Feel free to shoot me a PM and or an email and I'd be glad to discuss the details or various methods and help you out. Maybe we can even trade ideas for mutual benefit.
-Maebius

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this