I've been working on a 2D RTS for a little bit (the last ten minutes) and I've come up with this. Don't really know if anyone will need it except for a noob. One function controls health bar and the other just displays the mouse coordinates quickly (for development). When it comes to the colors then 1 is for black, 2 is for white, and 3 is for red.
` Health bar function...
function healthBar(mPosX,mPosY,barHeight,limit,c,state)
if c = 1
ink rgb(255,255,255),0
else
ink rgb(0,0,0),0
endif
box (mPosX - 10),(mPosY - 10),((mPosX + limit) + 10),((mPosY + barHeight) + 10)
if c = 1
ink rgb(0,0,0),0
endif
if c = 2
ink rgb(255,255,255),0
endif
if c = 3
ink rgb(255,0,0),0
endif
box mPosX,mPosY,(limit - state),(mPosY + barHeight)
endfunction
` Print the mouse coordinates...
function mouseCord(color)
if color = 1 then ink rgb(255,255,255),0
if color = 2 or color = 3 then ink rgb(0,0,0),0
box 40,10,110,70
set cursor 50,20
if color = 1 then ink rgb(0,0,0),0
if color = 2 then ink rgb(255,255,255),0
if color = 3 then ink rgb(255,0,0),0
print mousex()
set cursor 50,40
print mousey()
endfunction
a.k.a. "flockhound"