Health bar? (and Wordpad is a meanie butt-face D:)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Faefae
Newbie
Posts: 12
Joined: Wed Dec 19, 2012 5:57 pm
Contact:

Health bar? (and Wordpad is a meanie butt-face D:)

#1 Post by Faefae » Sat Dec 22, 2012 1:43 pm

Hello everyone, it's time for another completely-obvious-newb-question-of-the-day!

....How do I make a health bar?

I want to make one but I don't know and I can't use my common sense to think of how because Wordpad is annoying me and not keeping the text formatting when I paste code so it all ends up appearing in one big block of code-ness. *sadfaces*

User avatar
squark
Veteran
Posts: 277
Joined: Fri Aug 17, 2007 9:59 am
Completed: Tour de Pharmacy (Proofreader), The Abandoned Land: Book One (Proofreader)
Projects: Raven Hollow (Core Coder, Proofreader), The Universal Hope (Core Coder, Proofreader)
Organization: FlareBlue Entertainment
Location: Always somewhere behind you...
Contact:

Re: Health bar? (and Wordpad is a meanie butt-face D:)

#2 Post by squark » Sat Dec 22, 2012 2:08 pm

Screen Language is the way to go. I can't really give you any script at the moment, because I'm not at my project compy. But There's plenty of people around that know how to program a nice slider.

As for Wordpad not keeping code formatting, that's what copypasting into a code block is for (see that code tage up top? That's why it's there).

I wish you the best of luck.
Without communication, nothing is possible.
"All we see or seem
Is but a dream within a dream.

I stand amid the roar
Of a surf-tormented shore"
-- Edgar Allen Poe, "A Dream Within A Dream"
Current Projects:
Universal Hope Stalled
Raven Hollow (on hold for now)
Peace and Love,
Squark

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Health bar? (and Wordpad is a meanie butt-face D:)

#3 Post by PyTom » Sat Dec 22, 2012 2:38 pm

Code: Select all

screen health_bar:
    hbox:
         xalign 0.0 yalign 0.0
         text _("Health:")
         bar value AnimatedValue(health, range=100.0)

label start:
    $ health = 100
    show screen health_bar

    "I'm walking down the street..."

    $ health = 90

    "When I stub my toe."
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Faefae
Newbie
Posts: 12
Joined: Wed Dec 19, 2012 5:57 pm
Contact:

Re: Health bar? (and Wordpad is a meanie butt-face D:)

#4 Post by Faefae » Sun Dec 23, 2012 1:28 pm

@Squawk: O ___ O I didn't know WordPad did that....thanks! :mrgreen:

@PyTom THANKS! :mrgreen: :mrgreen: :mrgreen:

User avatar
octacon100
Regular
Posts: 163
Joined: Thu Sep 12, 2013 11:23 pm
Projects: Regeria Hope
Organization: Golden Game Barn
IRC Nick: Octacon100
Location: Boston, MA
Contact:

Re: Health bar? (and Wordpad is a meanie butt-face D:)

#5 Post by octacon100 » Thu Sep 12, 2013 11:25 pm

@PyTom

Thanks very much for posting that code! It's taken me 2 hours of searching and trial and error to set up a health bar, and when I saw that code, it only took a few minutes to get set up. Thanks very much!

hedleypty
Regular
Posts: 31
Joined: Mon Oct 20, 2014 12:52 am
Contact:

Re: Health bar? (and Wordpad is a meanie butt-face D:)

#6 Post by hedleypty » Fri Apr 17, 2015 4:22 am

I'd tried it! it was very cool!

Post Reply

Who is online

Users browsing this forum: zyric