Jos Elkink wrote:But that means that the colour is calculated just once when you click on the events page - it's not updated while you're looking at it... that's what you mean, right?
Right.
Moderators: Public Relations Department, Players Department, Programming Department, Game Mechanics (RD)
Jos Elkink wrote::?:
I think I misunderstand something. Do we mean by gradual that you actually see it change when you look at it, or just gradually more dark depending on your health, which means it changes slower than that you clock on the page?
What I mean is - it should be fairly simple to implement it in such a way that the background of the events list is coloured depending on your health / hunger. I quite like that idea. But that means that the colour is calculated just once when you click on the events page - it's not updated while you're looking at it... that's what you mean, right?
The colour should then depend on the health, but not linearly, so that it's only really visible when it gets bad. Some kind of exponential function. If anyone really wants to help this being implemented (mind you: no decision has been made yet), give me some formula how to calculate the colour...
Jos
Code: Select all
if (hunger>50) faintScript();
if (healthloss>50) woundsScript();
function woundsScript()
{
redValue=(healthloss-49)*5;
greenValue=68-((healthloss-49)*4);
/*some code here to change these values into hexadecimal, I don't
know how to do it in a simple way.
*/
document.bgColor="#" + redHex + greenHex + blueHex;
}
Code: Select all
<html><head>
<script language="JavaScript">
var backcolor, red=0, green=44, blue=0, redHex="00", greenHex="44", blueHex="00";
function hit()
{
red=red+2;
if (red>99) red=99;
if (green>0) green=green-1;
if (blue>0) blue=blue-1;
process();
}
function faint()
{
if (red<=blue) red=red+2;
if (red>99) red=99;
if (green<=blue) green=green+2;
if (green>99) green=99;
blue=blue+2;
if (blue>99) blue=99;
process();
}
function process()
{
if (red<10) redHex = "0" + red
else redHex=red;
if (green<10) greenHex = "0" + green
else greenHex=green;
if (blue<10) blueHex = "0" + blue
else blueHex=blue;
backcolor="#" + redHex + greenHex + blueHex;
document.bgColor = backcolor;
document.form1.box.value=backcolor;
}
</script>
</head>
<form name="form1">
<body BGCOLOR="#004400" text="white">
<input type="button" value="Click here to make the background redder" onClick="hit()">
<p>
<input type="button" value="Click here to make the background grayer" onClick="faint()">
<p>
Current background color value: <input type="text" name="box" lenght=8>
</form>
</body>
</html>
Jur Schagen wrote:What's wrong with the smileys of old? That used to show it not only to the char itself, but to anyone else as well... couldn't they be revived? Can't remember why they were removed... it was either server strain or the separating of hunger from health. If it was the latter, couldn't we just showing the lower one?
On a side note - shouldn't the hunger bar be visible to the rest of the world as well?

Users browsing this forum: No registered users and 1 guest