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

#1 2013-01-13 01:57:26

Hyper1
New Scratcher
Registered: 2013-01-11
Posts: 3

How to make your self have health?

How do you make yourself have health signed Hyper1!

Offline

 

#2 2013-01-13 03:30:07

RenOkshadia3537
New Scratcher
Registered: 2013-01-09
Posts: 33

Re: How to make your self have health?

Eat healthy foods and exercise  wink

Offline

 

#3 2013-01-13 11:28:29

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: How to make your self have health?

I suppose you meant in Scratch, so: It's as simple as creating a variable for health, and keeping track of it.

When the game starts, you reset it to a certain value. When the player touches an enemy, it's life is decreased. If the player's health reaches 0, game's over.

when gf clicked
set [Health v] to [100]
forever
    wait until <touching [enemy v]?>
    change [Health v] by [-10]
    if <(Health) < [1]>
        broadcast [game over v] //you decide what to do here.
    end
    wait until <not <touching [enemy v]?>> //so we don't lose too much health. optional.
end


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#4 2013-01-18 01:37:12

Hyper1
New Scratcher
Registered: 2013-01-11
Posts: 3

Re: How to make your self have health?

THANKS! Dude Check out my gametitans unleashed

Offline

 

#5 2013-01-18 15:39:55

Froggy4444
New Scratcher
Registered: 2013-01-17
Posts: 4

Re: How to make your self have health?

Use a variable for health.

Offline

 

Board footer