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

#1 2013-02-18 01:48:53

ZINGERX
Scratcher
Registered: 2013-02-18
Posts: 16

How do u make 2 players move at the same time?

I'm making a two player game, (with arrow keys) but the players just don't seem to to want to move at the same time! I NEED HELP!!!!O.0

Offline

 

#2 2013-02-18 02:49:57

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: How do u make 2 players move at the same time?

If you make a sprite that moves from the arrow keys, then duplicate that sprite, then both sprites (the original and the duplicate) will move at the same time when arrow keys are pressed. This is probably not what you want. So try these scripts

Sprite1

when gf clicked
forever
 if <key [up arrow v] pressed?>
  change y by [1]
 end
 if <key [down arrow v] pressed?>
  change y by [-1]
 end
 if <key [left arrow v] pressed?>
  change x by [-1]
 end
 if <key [right arrow v] pressed?>
  change x by [1]
 end

Sprite2

when gf clicked
forever
 if <key [w v] pressed?>
  change y by [1]
 end
 if <key [s v] pressed?>
  change y by [-1]
 end
 if <key [a v] pressed?>
  change x by [-1]
 end
 if <key [d v] pressed?>
  change x by [1]
 end

Make sure you use those if <key [up arrow v] pressed?> blocks instead of the hat blocks. The hat blocks only report one key at a time, and that's probably your problem. This way, it will always work.

I hope that helps  smile

PS. You can change what is inside the if blocks to change what happens when the keys are pressed  wink


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2013-02-18 15:03:11

ZINGERX
Scratcher
Registered: 2013-02-18
Posts: 16

Re: How do u make 2 players move at the same time?

YES! THAT HELPED SO MUCH! thx for replying! U R AWESOME:)!

Offline

 

#4 2013-02-18 18:10:31

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: How do u make 2 players move at the same time?

No worries, it's a pleasure  smile


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#5 2013-02-18 21:44:20

calebblakeman
New Scratcher
Registered: 2013-02-13
Posts: 2

Re: How do u make 2 players move at the same time?

its cool

Offline

 

Board footer