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

#1 2012-06-17 09:39:25

Garr8
Scratcher
Registered: 2011-08-10
Posts: 1000+

Going into cave

I am making a war game set in the Stone Age and the objective is to enter the enemy's cave and reduce its health to 0. I can't get the caveman to enter the cave instead, he goes all the way to the end of the screen. How can I get him to go behind the cave to look like he is going in it?


What I scored on Pokemon Quiz: Porygon

Offline

 

#2 2012-06-17 16:04:49

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: Going into cave

You will need something similar to this,

when gf clicked
forever
if <([x position v] of [caveman v]) > ([x position v] of [the cave v])>
go to front
end
This is for the cave sprite, yes, this time it HAS to be a sprite, or it won't work.

Last edited by sonicfan12p (2012-06-17 16:05:10)


Why are the secret organizations getting all the attention?  mad

Offline

 

#3 2012-06-17 16:36:52

bob6
Scratcher
Registered: 2010-07-01
Posts: 100+

Re: Going into cave

Or like this (script for caveman):

when gf clicked
forever
  if <touching [cave]?>
    hide
  else
    change x by (10)
  end
end
    

Last edited by bob6 (2012-06-17 16:39:11)


http://i46.tinypic.com/3148ksz.gif

Offline

 

#4 2012-06-17 17:04:05

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: Going into cave

bob6 wrote:

Or like this (script for caveman):

when gf clicked
forever
  if <touching [cave]?>
    hide
  else
    change x by (10)
  end
end
    

That won't work as needed, you should use sonicfan's


http://i46.tinypic.com/ao03lk.png

Offline

 

#5 2012-06-17 19:53:53

wahoo77
New Scratcher
Registered: 2012-06-17
Posts: 27

Re: Going into cave

try this

when gf clicked
forever
     go to front
this is for the cave

Offline

 

#6 2012-06-19 04:03:52

Jonathan20000212
Scratcher
Registered: 2011-10-11
Posts: 18

Re: Going into cave

Maybe cave man are like this!

when gf clicked
go to [Cave v]
set pen color to [#4D0000]
pen down
draw [cave]
forever
sleep inside [cave v]
end
(Try to make you own script!  smile  )

Last edited by Jonathan20000212 (2012-06-19 04:07:34)


Spy's mission

Offline

 

#7 2012-06-19 10:10:02

Garr8
Scratcher
Registered: 2011-08-10
Posts: 1000+

Re: Going into cave

Well there are two caves, which cave is it referring to in sonicfan's script?


What I scored on Pokemon Quiz: Porygon

Offline

 

#8 2012-06-19 19:43:29

Garr8
Scratcher
Registered: 2011-08-10
Posts: 1000+

Re: Going into cave

They did not work, do you want me to upload the project so you can have a look at it?


What I scored on Pokemon Quiz: Porygon

Offline

 

#9 2012-06-19 21:46:30

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Going into cave

PhirripSyrrip wrote:

bob6 wrote:

Or like this (script for caveman):

when gf clicked
forever
  if <touching [cave]?>
    hide
  else
    change x by (10)
  end
end
    

That won't work as needed, you should use sonicfan's

Looks like it would work fine to me?

The caveman goes right by 10 until its touching the cave at which point it hides and is no longer visible and thus appears to have entered the cave. Though admittedly to make this method look realistic would be harder and may require a mix of sprite and background art for the cave.


http://i50.tinypic.com/ded8m.png

Offline

 

#10 2012-06-19 22:38:29

wahoo77
New Scratcher
Registered: 2012-06-17
Posts: 27

Re: Going into cave

Smozzick wrote:

PhirripSyrrip wrote:

bob6 wrote:

Or like this (script for caveman):

when gf clicked
forever
  if <touching [cave]?>
    hide
  else
    change x by (10)
  end
end
    

That won't work as needed, you should use sonicfan's

Looks like it would work fine to me?

The caveman goes right by 10 until its touching the cave at which point it hides and is no longer visible and thus appears to have entered the cave. Though admittedly to make this method look realistic would be harder and may require a mix of sprite and background art for the cave.

He wants the caveman to go into the cave.

This will make it look like the cave made him dissaper

Offline

 

#11 2012-06-20 10:29:56

skippito
Scratcher
Registered: 2012-03-17
Posts: 100+

Re: Going into cave

Try this:

forever
  if <touching [Cave v]?>
    go back [enough to be behind cave] layers
  end
end

Offline

 

#12 2012-06-27 11:29:59

Garr8
Scratcher
Registered: 2011-08-10
Posts: 1000+

Re: Going into cave

wahoo77 wrote:

Smozzick wrote:

PhirripSyrrip wrote:


That won't work as needed, you should use sonicfan's

Looks like it would work fine to me?

The caveman goes right by 10 until its touching the cave at which point it hides and is no longer visible and thus appears to have entered the cave. Though admittedly to make this method look realistic would be harder and may require a mix of sprite and background art for the cave.

He wants the caveman to go into the cave.

This will make it look like the cave made him dissaper

It works except the caveman went extremely fast towards the cave.


What I scored on Pokemon Quiz: Porygon

Offline

 

Board footer