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

#1 2012-12-09 16:47:21

Misterbowlerhat
New Scratcher
Registered: 2012-12-09
Posts: 5

Death!

Hey! I have managed to make a health variable and made it work, but it doesn't stop at 0 or kill the enemy/ me. Any help?

Offline

 

#2 2012-12-09 17:07:03

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Death!

Well first of all, could you show your scripts or upload your project? Until then, it'll be a bit hard to help you.


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2012-12-10 08:30:48

eveadelekitty
Scratcher
Registered: 2012-12-05
Posts: 100+

Re: Death!

Try making a code (for your character) that says something like...

when gf clicked
if <(health)=[0]>
end
In this example your message will be restart.
broadcast [restart]
stop script
when i receive [restart]
In this case your start screen is called b1.
Below is the stage script for recieving restart.
when i receive [restart]
change to background [b1]
Say you have a creepy death scream for your primary character? Use that on the stage if primary character dies.
Your character's reaction... (you can put the sound here instead it'll work better)
when i receive [restart]
hide
play sound [example freaky screech]
Now for enemy death. Do the same thing except don't change backgrounds and use a diff sound.  Maybe make it change to a pool of blood costume then a dot costume (dot of the smallest size on the painter, you can see one in this script when the guy and rock disappear -> http://scratch.mit.edu/projects/eveadelekitty/2963896 )
and he'll look like he's dying if you use this block right
wait [1] secs

Offline

 

#4 2012-12-10 08:36:20

eveadelekitty
Scratcher
Registered: 2012-12-05
Posts: 100+

Re: Death!

Oh nm, the guy doesn't disappear.
But go to the costume creator in the enemy's costume, make a new costume, use the smallest brush size and put one dot. ONLY ONE!!! Now take the dude and test run. If this doesn't work ask a better scratcher!  tongue

Offline

 

#5 2012-12-10 09:55:06

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: Death!

Eve, you forgot to wrap your first if in a forever loop. Lemme put it all in one script;

when gf clicked
forever if <not <(health) > [0]>>
 set [health v] to [0]
 die script //Usually a hide block and a broadcast to end the game
end

Offline

 

#6 2012-12-10 16:27:02

Misterbowlerhat
New Scratcher
Registered: 2012-12-09
Posts: 5

Re: Death!

Thanks every one  big_smile

Offline

 

Board footer