By LadylexUK
Copied from ProjectSpark.com
In various 1st person shooters damage to the player is often shown by blood splatter in the players view, getting darker as they approach death. The way a player copes with this is to get out of danger, stop moving, and the health will restore and the blood splatter will fade away.
Here is the Kode to do that in Spark.
Using a player with a 1st person camera.
Health restoration
Code:
WHEN [not][moving] DO
…WHEN [health][>=][1] //this is so your player will die. Without this line the health will restore and they will never die
…/…WHEN DO [health][increment by][0.05] // or whatever speed you want the health to recover
…WHEN [health][>=][1] //this is so your player will die. Without this line the health will restore and they will never die
…/…WHEN DO [health][increment by][0.05] // or whatever speed you want the health to recover
Blood splatter
Code:
WHEN DO [numvar:opacity][=][clamp][max][1]min[0][(][max health][-][health][)][mutiplied by][0.01] //this sets the opacity of the splatter
WHEN [health][<][(][max health][divided by][2][)] DO [display][Blowing debris][red (either standard or a darker shade)][opacity][numvar:opacity][screen center][scale][50] // blood splatter starts to appear after the player has less than 50% health remaining
WHEN [health][<][(][max health][divided by][2][)] DO [display][Blowing debris][red (either standard or a darker shade)][opacity][numvar:opacity][screen center][scale][50] // blood splatter starts to appear after the player has less than 50% health remaining
Be aware that any blood in your game will probably disqualify it from the curated feeds.