This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-01-17 20:53:25

haloman298
New Scratcher
Registered: 2011-09-03
Posts: 18

How can you make regenerating health in a game?

I was trying to get a health meter in my game, but I can have it recharge properly.  How can I make it so that it only recharges after the player is not shot at after a set amount of time.
Please give suggestions.
Thanks.

Offline

 

#2 2012-01-17 21:20:52

Freakish
Scratcher
Registered: 2011-10-25
Posts: 1000+

Re: How can you make regenerating health in a game?

Here's an image of the script.


http://i.imgur.com/y3RBV.jpg

Offline

 

#3 2012-01-17 21:35:03

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: How can you make regenerating health in a game?

Or alternatively:

Code:

[when I receive [Shot]]
[reset timer]

[when Green Flag Clicked]
[forever if< < timer > wait_time > AND <health < maximum > >]
{
     [change [health] by (1)]
}

http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer