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

#1 2011-01-21 18:34:46

Hourken
New Scratcher
Registered: 2011-01-21
Posts: 6

How to make a sensor sprite?

I have money down in my game and monsters, but whenever I touch the money or the monsters my score dosn't go up or down.  Same with my health.  Someone tell me how to make a sensor sprite please.

Offline

 

#2 2011-01-21 19:49:43

jazed13
Scratcher
Registered: 2011-01-14
Posts: 20

Re: How to make a sensor sprite?

Ok some idea if the money is the sprite then do this

[blocks]<when green flag clicked><if><touching[Money><change{score}by(1>[/blocks]

and change the money with the health variable just modify what i had there for other things with this base scropt it shouldnt be that hard


Subscribe To The Scratch Tuturial Groups's Channel! http://www.youtube.com/user/Jazed13?feature=mhum
http://i1199.photobucket.com/albums/aa463/Jazed14/Subscribe.pnghttp://i1199.photobucket.com/albums/aa463/Jazed14/aspoKWEJ.gif

Offline

 

#3 2011-01-21 20:09:27

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: How to make a sensor sprite?

Yes, that's correct scripting.  smile


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#4 2011-01-22 03:55:32

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How to make a sensor sprite?

Well actually, you'd need a forever block, that only makes it so that if at the moment the flag is pressed it's touching... The correct scripting would be:

http://img204.imageshack.us/img204/9493/18172323.gif

Last edited by WeirdF (2011-01-22 03:55:47)


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#5 2011-01-22 07:09:02

Hourken
New Scratcher
Registered: 2011-01-21
Posts: 6

Re: How to make a sensor sprite?

But what about making a sensor sprite i still need that for the monsters and walls.

Offline

 

#6 2011-01-22 11:01:01

Lar-Rew
Scratcher
Registered: 2010-02-19
Posts: 100+

Re: How to make a sensor sprite?

Just have it go to the edge of the player and use the ghost effect to hide it  smile  .

Here is my bottom wall sensor script for a platformer I'm making:

http://i53.tinypic.com/2gvn4hx.jpg

Last edited by Lar-Rew (2011-01-22 11:03:24)

Offline

 

#7 2011-01-22 11:47:18

ian528
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: How to make a sensor sprite?

Lar-Rew wrote:

Just have it go to the edge of the player and use the ghost effect to hide it  smile  .

Here is my bottom wall sensor script for a platformer I'm making:

http://i53.tinypic.com/2gvn4hx.jpg

Also, add this to the script of the player: If "touchdown?" = true,
then set x to 0.

Last edited by ian528 (2011-01-22 11:47:34)

Offline

 

Board footer