Jump to content

Record Last Moves


jackmcnally

Recommended Posts

Hi Guys,

 

I appreciate your help! What I am doing is making a Choose Your Own Adventure Game and what I would like to do is the following.

 

  • Record the moves of the person
  • Put those moves on a page telling them their - say - 5 latest games
  • Record the time it took them to complete the adventure
  • Record that in a High Score database

 

I know that I will need to employ the use of MYSQL databases and PHP, but I'm a total noob! Any help would be greatly appreciated!

 

~ Jack

Link to comment
Share on other sites

There's not much general purpose design help we can give you other than "learn PHP and SQL."

 

You should have a table for the users (make them sign in) [minimum fields:  ID, username]

 

A table for the adventure as a whole [Minimum fields: ID, title, description]

 

A table for every step of the adventure [Minimum fields: ID, description, choiceAText, choiceAStepID, choiceBText, choiceBStepID (the choices should really be their own table, but I'm keeping it simple)]

 

A table that contains a userID, an adventureStepID, and the choice they made at that step. [Minimum fields: UserId, AdventureStepId, timestamp, NextStepChosen]

 

When they make a choice, insert a row into the last table, then load the step that they chose and display it.

 

When you want to show their history, select from the choices they made ordered by the timestamp of the choices.  You can JOIN to the steps table to get the text of each choice and then display their adventure in story mode.

 

-Dan

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.