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

One Ups, Or Lives logic

Archive: 5 posts


Hi folks. Having bit of trouble with some logic. I'm basically trying to create an upgrade when collected it rewards the player with an additional life in level. Player will start with 3 lives and if hit by an enemy will lose 1 life. Ideally I'd also like to cap lives at 10 but it isn't set in stone. So essentially If a player is hit and runs out of lives he will die.2014-06-16 21:30:00

Author:
KingerBrocku
Posts: 45


You could easily handle lives with a selector. Increment the selector if you gain a life, decrement the selector (with a negative signal) if you lose a life. If the selector is at the 0 life slot and the player loses another life, the player dies. If the selector is at the 10 lives slot and the player gains a life, it doesn't increment.
I'm sure there are more efficient ways of doing it, but the selector way is very straightforward.
You can put a tag on the power up/upgrade. so that when the player collects it, the tag is activated just before the power up/upgrade is destroyed (probably using a sequencer) and then use a tag sensor to increment the selector...
I'm guessing you're using sackbots/controllinators/something other than the actual player? It should be very easy in that case.
2014-06-16 22:30:00

Author:
AmazingKittyCat
Posts: 204


A selector would work, but I would probably give a counter a go. Should be simple enough to use a combiner to pulse in negative or positive values to remove or add lives. It would also save you the trouble of having to add a display as leaving it visible would take care of that, and it caps itself at whatever number you choose.2014-06-17 05:20:00

Author:
tdarb
Posts: 689


You could use analogue capping in a feedback loop so it caps at 10%, and every 1% is a life, that way all you have to do is change a battery 2014-06-17 05:50:00

Author:
amiel445566
Posts: 664


A counter should work perfect for your purposes; amiel's suggestion is great if you need more flexibility though. (Using feedback loops will allow you to adjust the amount of "lives" gained or lost upon the happening of some event to a very specific amount if necessary, and cap it off at whatever value to want to cap it off at.)2014-06-17 22:26:00

Author:
BIGGamerer
Posts: 182


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.