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

#1 2013-03-17 17:41:10

ToungeTwister
New Scratcher
Registered: 2013-03-15
Posts: 3

Help With Stopping Complex Moving

Okay, so spoiler: I'm making a soccer game! I have little players with numbers. When you press a certain player's number, he will move. My problem is I can't get one to stop moving when another number is pressed! Could you help?

Thanks in advance, ToungeTwister :p

Offline

 

#2 2013-03-17 17:59:53

Harald
New Scratcher
Registered: 2013-03-05
Posts: 34

Re: Help With Stopping Complex Moving

You could try with a variable that detects if a player is currently active.

if <(Active Player) = [Player 12]>
Move around, kick some balls, do whatever he wants
else
do nothing
Also make a
 
when [Player 12 v] clicked
wait [0.1] secs
if <(Active Player) = [none]>
set [Active Player v] to [Player 12]
stop script
end
if <(Active Player) = [Player 12]>
set [Active Player v] to [none]
stop script
Hope it helps.. And works. Good luck!

Offline

 

#3 2013-03-17 18:09:06

ToungeTwister
New Scratcher
Registered: 2013-03-15
Posts: 3

Re: Help With Stopping Complex Moving

Thanks so much! I'll give you credit on helping me with the project.

Offline

 

#4 2013-03-17 19:16:46

ToungeTwister
New Scratcher
Registered: 2013-03-15
Posts: 3

Re: Help With Stopping Complex Moving

Do you have any other suggestions? I can't use red scripts unless you can help me with that too.

Offline

 

#5 2013-03-17 19:27:08

Harald
New Scratcher
Registered: 2013-03-05
Posts: 34

Re: Help With Stopping Complex Moving

You don't need red scripts. The red blocks are just supposed to be whatever you already have for your sprite. Like moving keys and such.
Ignore the "Do nothing." It's just there to show that if the player isn't active, nothing will happen.

Offline

 

Board footer