5 Replies - 2853 Views - Last Post: 19 May 2009 - 08:53 PM Rate Topic: -----

#1 akiraboyz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-May 09

make life bar

Post icon  Posted 18 May 2009 - 07:55 PM

how make....

life..bar...or health..bar...like game fighting.....

in java ???
Is This A Good Question/Topic? 0
  • +

Replies To: make life bar

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5363
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: make life bar

Posted 18 May 2009 - 07:56 PM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
Was This Post Helpful? 0
  • +
  • -

#3 virgul  Icon User is offline

  • D.I.C Regular

Reputation: 44
  • View blog
  • Posts: 269
  • Joined: 18-March 09

Re: make life bar

Posted 18 May 2009 - 08:05 PM

I will not supply you with code, seeing as its impossible with the amount of information that you supplied, but think about it this way.

think of a life bar like a reverse loading screen, it goes to 100. So what you need to do is find what 100 is, does your guy have 100 life points, or does he have something like 1000, doesnt really matter, its easier if its a multiple of 10 >100.

So now what you would do if your guy has 100 health is you would make each damage take away 1 from his health, or making it 99 out of 100. the size of the box 100 should never change. so now you have a 99% filled box, from here it should be easier.

But lets say your guy has 1,000 life. 1% = 10 points now. so you can do doubles to allow for like 99.3% health.


Show some code and get more help =-
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5363
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: make life bar

Posted 18 May 2009 - 08:09 PM

View Postvirgul, on 18 May, 2009 - 09:05 PM, said:

But lets say your guy has 1,000 life.

My guy has infinite life. He also has minor regeneration abilities.
Was This Post Helpful? 0
  • +
  • -

#5 virgul  Icon User is offline

  • D.I.C Regular

Reputation: 44
  • View blog
  • Posts: 269
  • Joined: 18-March 09

Re: make life bar

Posted 18 May 2009 - 08:20 PM

well then, i guess your guy is freaking awesome!

How would you do unlimited though, would you just not decrement?
Was This Post Helpful? 0
  • +
  • -

#6 akiraboyz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-May 09

Re: make life bar

Posted 19 May 2009 - 08:53 PM

View Postvirgul, on 18 May, 2009 - 07:05 PM, said:

I will not supply you with code, seeing as its impossible with the amount of information that you supplied, but think about it this way.

think of a life bar like a reverse loading screen, it goes to 100. So what you need to do is find what 100 is, does your guy have 100 life points, or does he have something like 1000, doesnt really matter, its easier if its a multiple of 10 >100.

So now what you would do if your guy has 100 health is you would make each damage take away 1 from his health, or making it 99 out of 100. the size of the box 100 should never change. so now you have a 99% filled box, from here it should be easier.

But lets say your guy has 1,000 life. 1% = 10 points now. so you can do doubles to allow for like 99.3% health.


Show some code and get more help =-



hi..guyz...

i don't need....code...

but i need what step should i do...to finish it....
OK,guyz...


what import java is needed??
reverse loading screen == progress bar,isn't it???



View Postvirgul, on 18 May, 2009 - 07:05 PM, said:

I will not supply you with code, seeing as its impossible with the amount of information that you supplied, but think about it this way.

think of a life bar like a reverse loading screen, it goes to 100. So what you need to do is find what 100 is, does your guy have 100 life points, or does he have something like 1000, doesnt really matter, its easier if its a multiple of 10 >100.

So now what you would do if your guy has 100 health is you would make each damage take away 1 from his health, or making it 99 out of 100. the size of the box 100 should never change. so now you have a 99% filled box, from here it should be easier.

But lets say your guy has 1,000 life. 1% = 10 points now. so you can do doubles to allow for like 99.3% health.


Show some code and get more help =-



hi..guyz...

i don't need....code...

but i need what step should i do...to finish it....
OK,guyz...


what import java is needed??
reverse loading screen == progress bar,isn't it???
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1