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

#1 2009-03-07 13:16:17

CDromatron
Scratcher
Registered: 2009-02-09
Posts: 23

is this even possible?????????

I need help with my project. is there a way of saying...

if <touching (sprite 1)>glide to bla bla bla

is this possible with out pressing a button.  i need this because i want to make a pac-man with ghosts so if pac-man touches a ghost (or vica verca) he goes to some where? is this possible?

Offline

 

#2 2009-03-07 13:33:31

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: is this even possible?????????

Yes
<when green flag clicked>
<if><touching[ ghost]
<glide( x )secs to x sad  x )y sad  y)


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

#3 2009-03-07 13:37:58

CDromatron
Scratcher
Registered: 2009-02-09
Posts: 23

Re: is this even possible?????????

but the ghosts are set a corse and follow it doesn't the flag mean a button is pressed?

Offline

 

#4 2009-03-07 14:17:08

daydreamgirl
Scratcher
Registered: 2009-02-20
Posts: 42

Re: is this even possible?????????

demosthenes wrote:

Yes
<when green flag clicked>
<if><touching[ ghost]
<glide( x )secs to x sad  x )y sad  y)

You need a forever block around the if block.


Test Signature

Offline

 

#5 2009-03-07 14:52:18

bosox397
Scratcher
Registered: 2008-02-17
Posts: 1000+

Re: is this even possible?????????

well u could have a broadcast and recieve block without a block being pressed


Dear Scratch Users,
I'm done with scratch, or at least making projects. I have made one last big game, thats both fun and teaches a lesson about water. It'd mean a lot if you gave me feedback.                              http://scratch.mit.edu/projects/bosox397/569201

Offline

 

#6 2009-03-07 18:59:45

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: is this even possible?????????

Just do
<when green flag clicked>
<forever>
<if><touching[ ghost
  <glide( # )secs to x sad  # )y sad  #
<end>
<end>[/blocks]

And about your question:

CDromatron wrote:

but the ghosts are set a corse and follow it doesn't the flag mean a button is pressed?

The green flag is sort of a button, but it's the one people will automatically think starts the game. (when you play it online, it automatically gets pressed as soon as it loads.) So I'd recommend starting most of your scripts with it.


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#7 2009-03-08 07:49:43

bhz
Scratcher
Registered: 2008-07-06
Posts: 100+

Re: is this even possible?????????

hmnwilson wrote:

Just do
<when green flag clicked>
<forever>
<if><touching[ ghost
  <glide( # )secs to x sad  # )y sad  #
<end>
<end>[/blocks]

And about your question:

CDromatron wrote:

but the ghosts are set a corse and follow it doesn't the flag mean a button is pressed?

The green flag is sort of a button, but it's the one people will automatically think starts the game. (when you play it online, it automatically gets pressed as soon as it loads.) So I'd recommend starting most of your scripts with it.

Most...if not all
The rest should be started with
<when I receive[

Last edited by bhz (2009-03-08 07:50:06)

Offline

 

#8 2009-03-08 11:07:44

CDromatron
Scratcher
Registered: 2009-02-09
Posts: 23

Re: is this even possible?????????

ok thanks to all that helped  wink

Offline

 

#9 2009-03-08 13:53:24

bosox397
Scratcher
Registered: 2008-02-17
Posts: 1000+

Re: is this even possible?????????

bhz wrote:

hmnwilson wrote:

Just do
<when green flag clicked>
<forever>
<if><touching[ ghost
  <glide( # )secs to x sad  # )y sad  #
<end>
<end>[/blocks]

And about your question:

CDromatron wrote:

but the ghosts are set a corse and follow it doesn't the flag mean a button is pressed?

The green flag is sort of a button, but it's the one people will automatically think starts the game. (when you play it online, it automatically gets pressed as soon as it loads.) So I'd recommend starting most of your scripts with it.

Most...if not all
The rest should be started with
<when I receive[

Yes that is what I recommended


Dear Scratch Users,
I'm done with scratch, or at least making projects. I have made one last big game, thats both fun and teaches a lesson about water. It'd mean a lot if you gave me feedback.                              http://scratch.mit.edu/projects/bosox397/569201

Offline

 

#10 2009-03-09 08:39:19

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: is this even possible?????????

hmnwilson wrote:

Just do
<when green flag clicked>
<forever>
<if><touching[ ghost
  <glide( # )secs to x sad  # )y sad  #
<end>
<end>[/blocks]

I think it could work out better as

[blocks]<when green flag clicked>
<forever>
<wait until><< <touching[ ghost1  <or> <touching[ ghost2 >> ...etc
<glide( # )secs to x sad  ### )y sad  ###
<end>[/blocks]


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

Board footer