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

#1 2009-10-24 06:36:06

x_andrew_xx
Scratcher
Registered: 2009-10-13
Posts: 8

How to do this in a shooting game?????

I am doing this shooting game. I want to do this part where you have to shoot a sprite 3 times to die. How do i make the sprite on the third shot die???? Currently all sprites die on the 1st shot. I want to make the boss die when you shoot it three times. Pls help.

Offline

 

#2 2009-10-24 07:09:55

jacool
Scratcher
Registered: 2008-01-25
Posts: 1000+

Re: How to do this in a shooting game?????

Use a health variable for the boss and the damage code should be something like this:
When green flag clicked:
    show
    Set [health] to (3)
    forever
        if touching [bullet]
            change [health] by (-1)
            wait until not touching [bullet]
       
        if [health] < (1)
            hide               #Or what you want to happen when he dies


http://i571.photobucket.com/albums/ss159/JacobKar/svensktiger-1.png

Offline

 

#3 2009-10-25 16:11:33

Plantagenet
Scratcher
Registered: 2009-10-25
Posts: 2

Re: How to do this in a shooting game?????

I can't find a "not touching" box

EDIT found it.
"Not" under operators
"touching" under sensors

Sorry

Last edited by Plantagenet (2009-10-25 16:13:25)

Offline

 

Board footer