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

#1 2013-02-01 06:17:20

awesomeguyting
New Scratcher
Registered: 2013-01-26
Posts: 11

how do i make a hiding game?

I'm trying to make script that stops a sprite from being seen when it is behind another sprite.

Offline

 

#2 2013-02-01 12:11:10

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: how do i make a hiding game?

You could make it so that it hides if touching another sprite.

when gf clicked
forever if <touching? [sprite 2 v]>
broadcast [hide sprite one]
end


when i receive [hide sprite one v]
set [ghost] effect to (100) 
That could be one way.

Hope that helps,

CAA14

Offline

 

#3 2013-02-01 21:47:15

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: how do i make a hiding game?

CAA14 wrote:

You could make it so that it hides if touching another sprite.

when gf clicked
forever if <touching [sprite 2 v]?>
 broadcast [hide sprite one v]
when i receive [hide sprite one v]
set [ghost v] effect to (100) 
That could be one way.

Hope that helps,

CAA14

Fixed.

awesomeguyting wrote:

I'm trying to make script that stops a sprite from being seen when it is behind another sprite.

CAA14's method would work, though here's another way if you'd like to look (for the sprite that's showing/hiding):

when gf clicked
forever
 if (touching [Sprite2 v]?)
  set [ghost effect v] to (100)
 else
  set [ghost effect v] to (0)
end

I hope that this helps!

Last edited by ErnieParke (2013-02-01 21:49:08)


http://i46.tinypic.com/35ismmc.png

Offline

 

#4 2013-02-01 23:11:24

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: how do i make a hiding game?

Yes, that would be simpler.
But you must make sure that the sprite is told to "show" at some point, or the ghost effect won't make a difference.

Sorry, I'm still learning scratch.  smile


Regards,

CAA14

Offline

 

#5 2013-02-01 23:14:58

Blazingwave
Scratcher
Registered: 2012-10-27
Posts: 500+

Re: how do i make a hiding game?

Or you could simply use

forever
if <touching [sprite1]?>
   go to front

Last edited by Blazingwave (2013-02-01 23:15:37)


http://i42.tinypic.com/t8nrlh.gif  http://blocks.scratchr.org/API.php?user=Blazingwave&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/25flloj.gif=http://i45.tinypic.com/o8i97l.gif
http://i41.tinypic.com/s1lyyo.jpg

Offline

 

#6 2013-03-30 15:13:21

awesomeguyting
New Scratcher
Registered: 2013-01-26
Posts: 11

Re: how do i make a hiding game?

Thank You for helping me guys
You might see my new game soon now

Offline

 

#7 2013-03-30 21:39:28

shivadas
Scratcher
Registered: 2010-02-06
Posts: 100+

Re: how do i make a hiding game?

Here's the way I would do it:

when gf clicked
forever 
if (touching [Hiding Place] ?)
go back [1] layers
else
go to front
end
Hope that helps!


Please check out my latest project, Hunger Avenger!

Offline

 

Board footer