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

#1 2012-12-09 13:06:42

Ralphina1
New Scratcher
Registered: 2012-12-09
Posts: 7

Multiplayer, making your spawn follow your mouse, and more.

I'm trying to make a vitual world using scratch, (Im new, I've never used scratch before) and have a few questions, if they aren't possible I'll understand and try to work around it. I dont know how Im going to script this, so thats what I need help with (aka scratch blocks). Here are my questions:

Is it possible to make it multiplayer (yes I know about that old software that had the multiplayer and that most people didnt get it, I dont have it either)? If yes, how do I do that?

How do I (I would prfer the spawn to just move to the spot I click on) make my spawn go to where I click ? If thats not possible, how do I make my spawn follow my mouse?

If it is possible, how do I make it where the player presses a number and their spawn changes into a different one (like changing your character)?

If it is possible, how do I make it where you press a (different) number and the backgroumd changes?

I really hope you can answer my questions, since I really have high hopes for this game, thanks to all those who answer!

~Ralphina1

Offline

 

#2 2012-12-09 17:03:36

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Multiplayer, making your spawn follow your mouse, and more.

Ralphina1 wrote:

I'm trying to make a vitual world using scratch, (Im new, I've never used scratch before) and have a few questions, if they aren't possible I'll understand and try to work around it. I dont know how Im going to script this, so thats what I need help with (aka scratch blocks). Here are my questions:

[1]Is it possible to make it multiplayer (yes I know about that old software that had the multiplayer and that most people didnt get it, I dont have it either)? If yes, how do I do that?

[2]How do I (I would prfer the spawn to just move to the spot I click on) make my spawn go to where I click ? If thats not possible, how do I make my spawn follow my mouse?

[3]If it is possible, how do I make it where the player presses a number and their spawn changes into a different one (like changing your character)?

[4]If it is possible, how do I make it where you press a (different) number and the backgroumd changes?

I really hope you can answer my questions, since I really have high hopes for this game, thanks to all those who answer!

~Ralphina1

First of all, I wanted to say hello Ralpina1 and welcome to Scratch!

Now on to your questions:

1). At the moment, the only multiplayer supported is a single project with multiple characters, but as soon as Scratch 2.0 comes out, Scratch should support multiplayer across several projects being run at the same time online. Anyway, for now, you'll just have to create a new sprite that'll act as the second player.

2). There are two ways to do this. The first is to have a variable for the spawn's x position and another for its y position. Then, whenever a click is detected, set the x and y positions of the spawn point to the mouse. And finally, if you want to spawn, just use this block:

go to x: (x spawn) y: (y spawn)

The other method doesn't use the two variables. If you use it, put this script in whatever is spawning:

forever
 if (mouse down?)
  go to [mouse pointer v]
 end
 hide
 if (Spawning?)
  show
  repeat until (Done?)
   Scripts...
  end
 end

3). Yes it is possible, with a variable. Here's the script:

if (key [9 v] pressed?)
 change [spawn v] by (1)
 set [spawn v] to ((spawn) mod [Max Spawn Points])
 wait until <not (key [9 v] pressed?)>
end

And when spawning an object:

if <(spawn) = (0)>
 go to x: (12) y: (67)
end
if <(spawn) = (1)>
 go to x: (65) y: (67)
end
if <(spawn) = (2)>
 go to x: (65) y: (167)
end
More...

Note: There is a slightly more compact version using lists, so if you want to see it, just ask.  wink

4). This script is simple. In your background, use this script:

when gf clicked
forever
 if (key [5 v] pressed?)
  next background//Or swap this with what you need.
  wait until <not (key [5 v] pressed?)>
 end

I hope that this helps!

Last edited by ErnieParke (2012-12-09 17:23:48)


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2012-12-09 17:14:45

Ralphina1
New Scratcher
Registered: 2012-12-09
Posts: 7

Re: Multiplayer, making your spawn follow your mouse, and more.

Thanks! That really helps! Im totally clueless and cant figure out how to use it, so this is very helpfull to me!  big_smile

Offline

 

#4 2012-12-09 17:25:08

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Multiplayer, making your spawn follow your mouse, and more.

Ralphina1 wrote:

Thanks! That really helps! Im totally clueless and cant figure out how to use it, so this is very helpfull to me!  big_smile

Well I'm glad to here that this helped! And I wish you good luck on your project!


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer