I'm trying to figure out how to make my HUD system feature health similar to that seen in Zelda.
To those not familiar with the Zelda HUD, it shows a series of hearts, that can be divided in to fourths. You can have 3 hearts, 3 1/4 hearts, 3 1/2 hearts or 3 3/4 hearts.
I was wondering how this would be executed in a HUD system making each "heart" a different object.
Thanks.
ID:169613
May 25 2005, 5:05 pm
|
|
In response to Prodigal Squirrel
|
|
How do you check which heart is last in the list?
and How do you check when all the hearts in the list are empty? Thanks. |
In response to FireEmblem
|
|
Well, you could use associative lists.
And, to see the last item: list[list.len]. |
In response to Hell Ramen
|
|
'associative' lists? o.o
|
In response to FireEmblem
|
|
Like.
var/list/l=list("heart1"=4,"heart2"=4,"heart3"=3,"heart4"=0) Something like that would work. |
In response to Hell Ramen
|
|
Ah, thanks.
Okay, so in my HUD code right now I have <code> client/New() new/obj/Main/a(src) new/obj/Main/b(src) new/obj/Main/c(src) new/obj/Main/d(src) new/obj/Main/e(src) new/obj/Main/f(src) new/obj/Main/g(src) new/obj/Main/h(src) new/obj/Main/i(src) new/obj/Main/j(src) new/obj/Hearts/h1(src) new/obj/Hearts/h2(src) new/obj/Hearts/h3(src) ..() </code> How would I fit in the hearts list? |
In response to FireEmblem
|
|
...bump >_<
|
Prodigal Squirrel