This is a discussion on Re: Stratagy within the PHP Language forums, part of the PHP Programming Forums category; Create an object which represents a player. All information about the player can be stored on the object's attributes, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Create an object which represents a player. All information about the
player can be stored on the object's attributes, all actions possible can exist as object methods. to save the state of the player to the database, serialize() the object (which will produce a string). When you want to resume that player, simply unserialise the string that you stored in the text field. see http://www.php.net/manual/en/languag...ialization.php Alexander Ross wrote: > Sorry for the repost but I really need ideas here and I have a clock... > > PHP/POSTGRESQL > > Here's the cliff's notes version of my situation: > I'm makeing a simple role playing game where users gain points by answering > trivia question. They can then use their points (like skiball tickets) to > attepmt certain actions. Success ot failure is based on a roll of the dice. > If successfull, the users personal stats (i.e. knowledge (kn), charisma (ch) > ... basically think back to the hayday of Dungens & Dragons) increase based > on a rule for each action. For example: > > Action: GO TO COLLEGE > Cost: 15 points > *Success Rule1: KN +3, CH +1, ... > *Failure Rule1: KN -2,CH -1... > > *Each action wil have 3 success rules and 3 failure rules randomely chosen > once success is determined. > > That all being said, I need advice on how to store all this info so its > easily retrievable later. Thought? Suggestions? Jokes? > > Thanks > -- > Alexander Ross > alexross@bleen.net > > |