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

#1 2013-03-23 10:56:28

scratchy97
New Scratcher
Registered: 2013-02-11
Posts: 2

Fruit Ninja Lives

I want to create a script so that when the player swipes the bomb they lose a life instead of dying, how do i do this??? There are 4 bombs and the player has 3 lives!!!!!

Offline

 

#2 2013-03-23 12:47:55

Programmer_112
Scratcher
Registered: 2012-02-17
Posts: 100+

Re: Fruit Ninja Lives

Try something like

 When I receive [bomb swiped v]
Change [lives v] by (-1)

Last edited by Programmer_112 (2013-03-23 12:48:09)


http://i49.tinypic.com/rk60py.png

Offline

 

#3 2013-03-25 10:59:51

scratchy97
New Scratcher
Registered: 2013-02-11
Posts: 2

Re: Fruit Ninja Lives

This Really Wasnt Helpful!!!!!!!!! What Were You Thinking????

Offline

 

#4 2013-03-25 12:44:56

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: Fruit Ninja Lives

scratchy97 wrote:

This Really Wasnt Helpful!!!!!!!!! What Were You Thinking????

You have a script that says when a bomb is swiped (if touching [bomb v]>) change a variable called lives (which is set to 3 at the start) by - 1. Have another that says when lives = 0 go to menu screen.

Offline

 

#5 2013-03-25 13:57:55

7734f
Scratcher
Registered: 2010-12-23
Posts: 500+

Re: Fruit Ninja Lives

OK, I think I can help. Here are the mouse/knife's scripts:

when gf clicked
forever//if this ever happens, it will always catch it
 if <touching [bomb v]?>//if it's touching the bomb, it does this
  change [lives v] by [-1]
  wait until <not<touching [bomb v]?>>//waits so it doesn't over-count
 end
end
end
That should work. Hope that helped!

           Sincerely,

                                       ~7734f


http://internetometer.com/image/38992.png   http://i37.tinypic.com/2qixx6c.png

Offline

 

Board footer