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

#1 2009-06-18 05:09:39

Stigger4234
Scratcher
Registered: 2009-06-17
Posts: 1

Hey im new.

Hi im new, and i got a question.
1. Can You make a health system, like if your hit by something you loose a health?

Thx

Offline

 

#2 2009-06-18 20:29:30

boogawk
Scratcher
Registered: 2009-03-07
Posts: 100+

Re: Hey im new.

Of course! With scratch, you can do anything. Just use variables. If you don't know what variables are, go to the topic how do I use variables in forums.

Last edited by boogawk (2009-06-18 20:29:41)


http://i660.photobucket.com/albums/uu328/boogawk/shadingbanner.jpg

Offline

 

#3 2009-06-18 20:48:39

Mike_W
Scratcher
Registered: 2009-02-05
Posts: 100+

Re: Hey im new.

The game I am working on right now I use a translucent heart image to indicate health.

I call a routine set Size to Hits/Max hits so it goes and shrink when the player takes damage - and it looks cool

Offline

 

#4 2009-06-18 21:08:14

fireball123
Scratcher
Registered: 2008-05-08
Posts: 1000+

Re: Hey im new.

or you can make a health bar where the X position is determined by health.


I did it for the Lolz

Offline

 

#5 2009-06-23 16:23:04

boogawk
Scratcher
Registered: 2009-03-07
Posts: 100+

Re: Hey im new.

Pretend the green spike lowers your health. You could say:
wait until touching green spike
set health to health minus 1
(the variable)

Last edited by boogawk (2009-06-23 16:27:33)


http://i660.photobucket.com/albums/uu328/boogawk/shadingbanner.jpg

Offline

 

#6 2009-06-24 12:30:07

zbugni
Scratcher
Registered: 2008-12-13
Posts: 500+

Re: Hey im new.

Of course!  Variables could keep track of health, for example:
   [blocks]<when green flag clicked>
   <forever if><touching[ enemy
    <change{ health }by(-1[/blocks]

Offline

 

#7 2009-06-26 05:58:15

Despair
Scratcher
Registered: 2009-06-03
Posts: 16

Re: Hey im new.

Yeah variables are very helpful.

Offline

 

#8 2009-06-27 11:57:58

smartalex4
Scratcher
Registered: 2009-06-27
Posts: 14

Re: Hey im new.

Variables are the way to go!

Offline

 

Board footer