00:00
00:00
Newgrounds Background Image Theme

Patrick8008 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

How can i Create a half circle HP

361 Views | 2 Replies
New Topic Respond to this Topic

How can i Create a half circle HP 2014-05-17 23:16:54


How can i create a half circle hp bar for my characters health. I tried looking on google but not much comes up about making half circle hp bars.


Something about art?

lol excuse the hand

Response to How can i Create a half circle HP 2014-05-18 06:18:20


At 5/17/14 11:16 PM, evowolfdemon wrote: How can i create a half circle hp bar for my characters health. I tried looking on google but not much comes up about making half circle hp bars.

It depends how you want to do it. Do you want to do it completely with code or as graphics that you then manipulate with code?

Actually, it doesn't really matter if you separate the logic from the graphics. Build a class which has 3 different states: full, half, empty which change the graphics accordingly - whether that be graphics drawn by code, loaded bitmap graphics or vector graphics from an SWC. From here, you could store instances of the class in an array based on how much health the player has, and based on whatever the condition is to lose health (e.g. one hit causes half a life to be lost) you can loop the array and find the next non-empty instance of your class and change its state with some method.

Alternatively, you can go the extremely static (and not recommended by me) way, where the first frame has all health filled, the second frame has half of a life missing, the third with a whole life missing etc. Then you can just increment the frame with a nextFrame() command.

Response to How can i Create a half circle HP 2014-05-18 12:33:17


Thanks


Something about art?

lol excuse the hand