ID:138805
 
Code:
obj/HUDS
HP
layer = 69
HpBar
New()
var/icon/I = new('Health bar.dmi')
I.Scale(150,150)
src.icon = I
icon_state = "100"
screen_loc = "2,15"
mob
proc
UpdateHUD()
if(src.client)
var/healthpercent=round(src.Health/src.MaxHealth*100,100)
if(healthpercent>100) healthpercent=100
if(healthpercent<0) healthpercent=0
for(var/obj/HUDS/HP/X in src.client.screen)
X.icon_state=num2text(healthpercent)


Problem description:

Image and video hosting by TinyPic

Is what comes out, while the stuff in the red circle should come out as this...

Image and video hosting by TinyPic


Have I done something wrong in the code or?.... The icon's size is 150x150 so I'm not sure why it isn't coming out as it should?

EDIT - My map format was wrong, all fixed now.

Map format changed to TOPDOWN_MAP
Asakuraboy wrote:
Code:
> obj/HUDS
> HP
> layer = 69
> HpBar
> New()
> var/icon/I = new('Health bar.dmi')
> I.Scale(150,150)
> src.icon = I
> icon_state = "100"
> screen_loc = "2,15"
> mob
> proc
> UpdateHUD()
> if(src.client)
> var/healthpercent=round(src.Health/src.MaxHealth*100,100)
> if(healthpercent>100) healthpercent=100
> if(healthpercent<0) healthpercent=0
> for(var/obj/HUDS/HP/X in src.client.screen)
> X.icon_state=num2text(healthpercent)
>

Problem description:

Image and video hosting by TinyPic

Is what comes out, while the stuff in the red circle should come out as this...

Image and video hosting by TinyPic


Have I done something wrong in the code or?.... The icon's size is 150x150 so I'm not sure why it isn't coming out as it should?

Your Game Is Awesome.