Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » multiplayer
- firefighter04
-
17 posts
multiplayer
I want to make a soccer game so how do I do the cloud script
- Crimson19
-
1000+ posts
multiplayer
I want to make a soccer game so how do I do the cloud script
With 11 players? That's ambitious, you need 44 (one for x and y for each player on each team (make that 50 if you want the linesmen and ref)) variables which is impossible as you can only use oan alternative to a cloud list. Then use this:
forever
set [player 1 x v] to (x position)
set [player 1 y v] to (y position)
end
You must do this for every player/official. Changing the one every time.
Last edited by Crimson19 (April 3, 2015 18:44:39)
- Crimson19
-
1000+ posts
multiplayer
I want to do a one on one
That's easy then. You need four cloud variables.
Put the first one inside the first player and the second one in the second player.
if <(player) = [1 ]> then //player [b]shouldn't[/b] be cloud
forever
set [player 1 X v] to (x position) //player 1 x should be a cloud variable
set [player 1 y v] to (y position) //player 1 y should be a cloud variable
end
end
if <(player) = [2 ]> then
forever
set [player 2 X v] to (x position)
set [player 2 y v] to (y position)
end
end
- Discussion Forums
- » Help with Scripts
-
» multiplayer