How do I make a page that remembers scores & opens links based on an "if...then..." test?
Date: 10/04/07
(HTML Help) Keywords: html, java
Hi all,
I am trying to create a set of pages that's like a little "choose your own adventure" style game. It started off as a basic html page (i.e. you click on your chosen option and it takes you to the next stage in the story), but i would like to make it more intelligent.
I would like to be able to have it so that the user accumulates various scores, and then is given options based on what their score is.
For example, a score might be "money". If the user chooses some option, it takes them to a page that adds "50" to their "money" score.
Later on, they may encounter a page where "if money >= 50, direct to link 1; if money < 50, direct to link 2."
Does anybody know how to do this?
I have been trawling through countless Javascript and HTML tutorials for the last couple of hours, and have only found little bits and peices of what i need.
I have found examples of "if... then..." statements in Java, but i have not found any way to establish some score ("money") that can accumulate when a particular page is accessed.
I have also not found any way to make the outcome of an "if... then..." test determine which page you are then linked to.
Can anybody help?
(cross-posted to javascript)
Source: http://community.livejournal.com/htmlhelp/2415635.html