Re: Stratagy

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, ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-09-2003
Terence
 
Posts: n/a
Default Re: Stratagy

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
>
>


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0