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

#1 2012-03-11 22:15:27

JcpoppTest
Scratcher
Registered: 2011-03-27
Posts: 2

Scripting help

http://scratch.mit.edu/projects/JcpoppTest/2389774 Please click the link to the right. Is there a possible way to determine the second place car? Thanks for helping!

Offline

 

#2 2012-03-11 22:30:06

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Scripting help

I would put this script in every car:

When I receive [race begin]
wait until <touching [finish line v]?>
if<(first)=[unknown]>
set [first] to [car number]
else
if<(second)=[unknown]>
set [second] to [car number]
end
end
And put this anywhere:
When I receive [race begin]
set [first] to [unknown]
set [second] to [unknown]

Last edited by MoreGamesNow (2012-03-11 22:30:42)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-03-11 22:39:29

jcpopp
Scratcher
Registered: 2010-10-30
Posts: 100+

Re: Scripting help

I will try this when I get a chance. Thanks for the response!


Join Nitro Type! It really improves your typing skills  big_smile

Offline

 

#4 2012-03-11 22:51:00

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Scripting help

No problem  smile


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-03-12 07:51:05

Splodgey
Scratcher
Registered: 2011-04-26
Posts: 500+

Re: Scripting help

MoreGamesNow wrote:

I would put this script in every car:

When I receive [race begin]
wait until <touching [finish line v]?>
if<(first)=[unknown]>
set [first] to [car number]
else
if<(second)=[unknown]>
set [second] to [car number]
end
end
And put this anywhere:
When I receive [race begin]
set [first] to [unknown]
set [second] to [unknown]

Better way:

When I receive [race begin v]
wait until <touching [finish line v]?>
add [car number] to [finished v]
and
When I receive [race begin v]
delete [all v] of [finished v]
that way, to find out who was in a position use
(item (Position) of [finished v])

Last edited by Splodgey (2012-03-12 07:51:53)

Offline

 

#6 2012-03-12 15:56:44

blobmaster
Scratcher
Registered: 2010-12-20
Posts: 11

Re: Scripting help

how to make this script stop sprite for 26 seconds

Offline

 

#7 2012-03-12 16:25:52

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Scripting help

I concur with Splodgey.  His/her way is better.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#8 2012-03-13 16:42:41

jcpopp
Scratcher
Registered: 2010-10-30
Posts: 100+

Re: Scripting help

Ok, thank you so much for the help!!!  big_smile


Join Nitro Type! It really improves your typing skills  big_smile

Offline

 

Board footer