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

#1 2012-02-27 15:33:34

DanCstudio
Scratcher
Registered: 2011-10-05
Posts: 12

Help with Mesh!

Hi!
I'm working on a little Mesh RPG, and I'm wondering how you get the sprite of your character to be displayed in a different position on the other player's screen.
By this, I mean when I move, I move on the other player's screen without them moving themselves.
Here is the Project if you'd like to help (:

http://www.scratch.mit.edu/projects/DanCstudio/2358024

I currently am working on setting variables tobroadcasts.
However, I have a feeling there's a better way!
Please, I beg you, help!
big_smile
All I can get at the moment is the one knight sprite playing as both characters, but only moving on one screen.
I've got the trees to react on both screens,though, when you click to chop one down, it does chop on the other player's screen too.
But any help on movement is fantastiiiiiiiiiiic!
smile

Offline

 

#2 2012-02-27 17:08:56

t-boy
Scratcher
Registered: 2008-05-15
Posts: 21

Re: Help with Mesh!

idk its hard to answer out of context but i suppose you can just use the variables themselves since both variables and broadcasts are shared over mesh. to access a remote variable, you need to save the project with the variables you are going to use, then open up two of those projects and mesh them together. then under sensing pull out a
([slider] sensor value) block and click the dropdown menu. there should be a list of all the remote project's variables. say you have two variables, rpgXpos and rpgYpos. if you said forever goto x: rpgXpos sensor value y: rpgYpos sensor value it be saying, set the position of the sprite in this project to the x and y values of the sprite in the other project. hope this helps

Offline

 

#3 2012-02-28 14:52:47

DanCstudio
Scratcher
Registered: 2011-10-05
Posts: 12

Re: Help with Mesh!

Heyy!
Thanks (:
It took a while to realise what you meant, but it's almost working now!!
smile ))))
I used this a script that has 2 versions on the 2 projects.
One project is the host version, one is the Guest version.
One the versions your character and the guest is swapped around.
When you move your character, it send out a broadcast saying:
Change x/y by 1.8
The 1.8 is the speed of my sprite.
It makes the character on the other screen appear to be moving while the player is standing still.
It's confusing, but it's a nice Multiplayer game now, ready for release over the next few days  smile

Offline

 

#4 2012-02-28 14:55:01

DanCstudio
Scratcher
Registered: 2011-10-05
Posts: 12

Re: Help with Mesh!

The main problem with it was that the scenery moves around your character, not your character around a stationary scenery.
This has helped me no end, and I'm sure I can put this into use in any otehr projects.
I love programming stuff like this, that feeling when you achieve it is.... amazing <3

Offline

 

Board footer