Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

health bars?

Archive: 7 posts


Health Bar
I don't understand that other guys tutorial so can someone tell me how to make a health bar and how to make it lose health when I attack? (emitted objects). Healing options would be good too.
2011-01-23 18:27:00

Author:
jonlolz
Posts: 155


The easiest way to make a health bar is to put a visible timer on an invisible piece of hologram that follows the object/person it belongs to, then emit a tag when it takes damage. When a tag sensor picks up that tag it moves the timer (health). You'll have to invert the timer to make it start at the top though.2011-01-23 18:51:00

Author:
xero
Posts: 2419


The way I did it was with 4 blocks of holo (representing the players health).

Then I used 3 OR gates (one with 4 inputs, one with 3, and one with 2) hooked up to a selector that has 5 outputs (4/4, 3/4, 2/4, 1/4, dead).

Then, I used an impact sensor hooked up to the selector's cycle input, to detract health with each hit.

Lastly, I used a tag sensor hooked up to the selector's first input (full health - 4/4) so when the player goes near a health item, it restores their health back to full.

I'm going to do you a picture so you understand better (I'm a tad rubbish at explaining) so I'll upload that in a couple of minutes).
2011-01-23 19:13:00

Author:
alexbull_uk
Posts: 1287


The way I did it was with 4 blocks of holo (representing the players health).

Then I used 3 OR gates (one with 4 inputs, one with 3, and one with 2) hooked up to a selector that has 5 outputs (4/4, 3/4, 2/4, 1/4, dead).

Then, I used an impact sensor hooked up to the selector's cycle input, to detract health with each hit.

Lastly, I used a tag sensor hooked up to the selector's first input (full health - 4/4) so when the player goes near a health item, it restores their health back to full.

I'm going to do you a picture so you understand better (I'm a tad rubbish at explaining) so I'll upload that in a couple of minutes).

pictures help a lot thanks...
2011-01-23 19:18:00

Author:
jonlolz
Posts: 155


pictures help a lot thanks...

http://i166.photobucket.com/albums/u106/alexbulluk/LBP2HealthTutorial.png?t=1295811169

Hope that helps. I coloured the wires coming from the selector so hopefully you see how it works.

Basically, it works by each time you get hit, one light is turned off, and when you get all your lights turned off, you die, and lose 100 points.

If you need more help I'll see what I can do. I could probably share an example if you really need me to.
2011-01-23 19:34:00

Author:
alexbull_uk
Posts: 1287


thhanks but what does the impact sensor do? Nothing is going to be impacting on my enemies and me2011-01-23 19:46:00

Author:
jonlolz
Posts: 155


thhanks but what does the impact sensor do? Nothing is going to be impacting on my enemies and me

Then replace it with a tag sensor, or something to detect "getting hit" to lose health.
2011-01-23 19:55:00

Author:
xero
Posts: 2419


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.