Okay, I am creating a battle system for a friends website, and I have figured out the majority of everything that I need, but I decided about half way into it, that I wanted to reload the variables so that it would be an instantaneous thing rather than a reload of the page further down.
As an example:
<script language="javascript">
(In the head of the document)
var Hit_points: 10
var Max_HP: 10
</script>
Then into the body of the document.
<script language="javascript">
document.writeln("Hit Points:" + Hit_points + "/" + Max_HP);
</script>
Now what I want that to do, is every time he get's hit I want the variable Hit_points to lower without input from my friend.
Is there any way that I can possibly do this, or will I just have to continually reload the page?
Any help is appreciated. Thanks.
As an example:
<script language="javascript">
(In the head of the document)
var Hit_points: 10
var Max_HP: 10
</script>
Then into the body of the document.
<script language="javascript">
document.writeln("Hit Points:" + Hit_points + "/" + Max_HP);
</script>
Now what I want that to do, is every time he get's hit I want the variable Hit_points to lower without input from my friend.
Is there any way that I can possibly do this, or will I just have to continually reload the page?
Any help is appreciated. Thanks.