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

#1 2012-08-31 10:21:38

rsakoor
Scratcher
Registered: 2012-07-04
Posts: 43

How do I get a sprite to hide as soon as it touches another sprite?

Download the project and read the notes at the side... Help will be seriously appreciated....

http://scratch.mit.edu/projects/rsakoor/2755912

Offline

 

#2 2012-08-31 11:12:06

Zarule6
New Scratcher
Registered: 2012-08-02
Posts: 36

Re: How do I get a sprite to hide as soon as it touches another sprite?

It's because the colour of the edges and in between the paper is white,simply go to the paint editor and make the white transparent  smile 

Just tested it and it worked !

Hope it helps.

Offline

 

#3 2012-09-01 07:02:26

rsakoor
Scratcher
Registered: 2012-07-04
Posts: 43

Re: How do I get a sprite to hide as soon as it touches another sprite?

Zarule6 wrote:

It's because the colour of the edges and in between the paper is white,simply go to the paint editor and make the white transparent  smile 

Just tested it and it worked !

Hope it helps.

It does work but as soon as it touches it, it hides for like 0.1 sec and reappears... Allowing users to gain really insane high scores just by touching the paper sprite... Have a look yourself... You'll understand what I mean...

http://scratch.mit.edu/projects/rsakoor/2755912

Offline

 

#4 2012-09-01 09:38:41

Zarule6
New Scratcher
Registered: 2012-08-02
Posts: 36

Re: How do I get a sprite to hide as soon as it touches another sprite?

at the paper sprite do the following

when I receive [plybutnnclciked v]
forever
if <touching (prince v)?>
set [show_hide v] to (1) // make a new variable to hold count of the show_hide loop)
change [score v] by (1)
 
now for the script aboth it


when gf clicked
set [show_hide v] to (0) 
hide
forever
 if <(playstate)=(1)>
  show
end
 if <(playstate)=(0)>
  hide
end
if <(show_hide)=(1)>
hide
stop script 
(just edit the already made scripts in your paper sprite  smile   )

Offline

 

#5 2012-09-02 06:59:58

rsakoor
Scratcher
Registered: 2012-07-04
Posts: 43

Re: How do I get a sprite to hide as soon as it touches another sprite?

Zarule6 wrote:

at the paper sprite do the following

when I receive [plybutnnclciked v]
forever
if <touching (prince v)?>
set [show_hide v] to (1) // make a new variable to hold count of the show_hide loop)
change [score v] by (1)
 
now for the script aboth it


when gf clicked
set [show_hide v] to (0) 
hide
forever
 if <(playstate)=(1)>
  show
end
 if <(playstate)=(0)>
  hide
end
if <(show_hide)=(1)>
hide
stop script 
(just edit the already made scripts in your paper sprite  smile   )

Thanks- I tried it, it worked...

Offline

 

#6 2012-09-02 09:31:26

rsakoor
Scratcher
Registered: 2012-07-04
Posts: 43

Re: How do I get a sprite to hide as soon as it touches another sprite?

I copied this for my second litter sprite... And guess what, if I touch one of the litter pieces, both vanish (whichever one I touch from the 2)...

Sorry, for constantly bothering you, You see I'm a hopeless scratcher... Lol

Offline

 

#7 2012-09-02 09:36:29

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: How do I get a sprite to hide as soon as it touches another sprite?

Sorry im on ipad  smile 

Tried broadcast?


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#8 2012-09-04 06:55:36

rsakoor
Scratcher
Registered: 2012-07-04
Posts: 43

Re: How do I get a sprite to hide as soon as it touches another sprite?

Zarule6 wrote:

at the paper sprite do the following

when I receive [plybutnnclciked v]
forever
if <touching (prince v)?>
set [show_hide v] to (1) // make a new variable to hold count of the show_hide loop)
change [score v] by (1)
 
now for the script aboth it


when gf clicked
set [show_hide v] to (0) 
hide
forever
 if <(playstate)=(1)>
  show
end
 if <(playstate)=(0)>
  hide
end
if <(show_hide)=(1)>
hide
stop script 
(just edit the already made scripts in your paper sprite  smile   )

For my can sprite, I set (show_hide)=0)>, Guess what that did, it appeared when I touched my paper sprite (I am ok with that happening) and when touching the can sprite, it shows constantly (it supposedly be hiding after 1 touch) and score goes mad with it... Lol..

Have a look http://scratch.mit.edu/projects/rsakoor/2762117 and read the project notes at the side... Thanks...

Last edited by rsakoor (2012-09-04 09:26:35)

Offline

 

#9 2012-09-05 07:01:23

rsakoor
Scratcher
Registered: 2012-07-04
Posts: 43

Re: How do I get a sprite to hide as soon as it touches another sprite?

I've manged to sort the first problem out from the 3 listed in the notes
http://scratch.mit.edu/projects/rsakoor/2763491 - This link is the game that has sorted its paper, can, crisp packet and bottle sprite out... Now, they do hide once Prince has touched them... Lol... But other 2 problems remain...

Offline

 

#10 2012-09-05 11:55:40

Joewheeeeler
Scratcher
Registered: 2012-05-17
Posts: 40

Re: How do I get a sprite to hide as soon as it touches another sprite?

I Use some Type of Coding that allows me to do that when my Main Character touches the other Characters he is collecting... Have a look Here and Download it Here My Other Game also contains those features to!  wink  Good Luck!


http://i.imgur.com/CxwNg.gif

Offline

 

#11 2012-09-21 04:35:45

rsakoor
Scratcher
Registered: 2012-07-04
Posts: 43

Re: How do I get a sprite to hide as soon as it touches another sprite?

Ive finished my game... The link is below (Please comment):

http://scratch.mit.edu/projects/rsakoor/2791773

Offline

 

#12 2012-09-28 12:04:09

rsakoor
Scratcher
Registered: 2012-07-04
Posts: 43

Re: How do I get a sprite to hide as soon as it touches another sprite?

Check my game out

http://scratch.mit.edu/projects/rsakoor/2791807

http://i.imgur.com/yO3pY.gif

Last edited by rsakoor (2012-09-28 12:05:03)

Offline

 

#13 2012-09-28 18:54:29

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: How do I get a sprite to hide as soon as it touches another sprite?

above once is enough. No need to bump the post again and again. If you really want to, please post in the show and tell section.

Last edited by KrIsMa (2012-09-28 18:54:55)


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#14 2012-09-29 09:35:45

legobob23o
Scratcher
Registered: 2012-06-22
Posts: 500+

Re: How do I get a sprite to hide as soon as it touches another sprite?

This is the script:

when gf clicked
forever if <touching [sprite wanting to be touched v]?>
  hide

Last edited by legobob23o (2012-09-29 09:35:55)

Offline

 

#15 2012-09-29 09:57:24

maxamillion321
Scratcher
Registered: 2011-06-17
Posts: 500+

Re: How do I get a sprite to hide as soon as it touches another sprite?

when gf clicked
if <touching [Sprite 2 v]?>
hide
end

Last edited by maxamillion321 (2012-09-29 09:57:51)

Offline

 

#16 2012-09-29 11:58:51

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: How do I get a sprite to hide as soon as it touches another sprite?

maxamillion321 wrote:

when gf clicked
if <touching [Sprite 2 v]?>
hide
end

legobob23o wrote:

This is the script:

when gf clicked
forever if <touching [sprite wanting to be touched v]?>
  hide

They all dont work, you forgot the forever loop.


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

Board footer