Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » A rather ambitious cloud Pong Project.
- Griftor05
-
13 posts
A rather ambitious cloud Pong Project.
Hello, I'm trying to make a game where you can play Pong online. I have a pretty good idea on how to get the bars to move in respect to where your mouse goes, etc., but what I can't figure out is a way for the computer to check whether a person is already playing on a particular color (which will be the sides, red and blue). To explain a little further, I don't want to have two people trying to control red while no one controls blue, but I'm not really sure how to check whether a person is already playing without asking them to say, sign in or out, which I know most people would do, but one person would forget, and it just wouldn't work.
- andre_rifaut
-
100+ posts
A rather ambitious cloud Pong Project.
For the game pong, players should be very reactive when playing. If they are not sufficiently reactive, they will loose all balls. In that case the game is not interesting for players.
You can make the assumption that a player which is not reactive is non longuer playing (= quit the game).
When a player begin the game, you can generate a random number between 100000000 and 999999999.
Then if you have two players at the same time, you just assign the lowest number to green et the highest one to the other color.
When there are three players or more, you just “stack” their numbers in one cloud var. Note that all numbers have a length of 9 digits, so it is easy to glue them in one var and them separate them …
Have fun.
You can make the assumption that a player which is not reactive is non longuer playing (= quit the game).
When a player begin the game, you can generate a random number between 100000000 and 999999999.
Then if you have two players at the same time, you just assign the lowest number to green et the highest one to the other color.
When there are three players or more, you just “stack” their numbers in one cloud var. Note that all numbers have a length of 9 digits, so it is easy to glue them in one var and them separate them …
Have fun.
- mwiedmann
-
100+ posts
A rather ambitious cloud Pong Project.
I don;t want to be a downer, but the cloud variables have proven to be too slow and unreliable for this type of game. I don't think you will be able to get the kind of reaction time you want. One thing that is a problem is the cloud log. When you work on your game and it is not shared, the cloud log doesn't update, so it appears that you get better response time from them. Once you share your project it will slow down a lot and the game may not be playable.
I've tried a few different multiplayer games and this has been my experience. It still may be worth a shot though, because they may make improvements to cloud vars in the future.
I've tried a few different multiplayer games and this has been my experience. It still may be worth a shot though, because they may make improvements to cloud vars in the future.
Last edited by mwiedmann (June 23, 2013 20:26:17)
- Griftor05
-
13 posts
A rather ambitious cloud Pong Project.
@andre_rifaut
Thanks for the idea. I never thought of responsiveness working. I'll give it a shot!
@mwiedmann
Well, I'll give it a shot, and hope for the best, but thanks for the forewarning. Hopefully they will get this fixed.
Thanks for the idea. I never thought of responsiveness working. I'll give it a shot!
@mwiedmann
Well, I'll give it a shot, and hope for the best, but thanks for the forewarning. Hopefully they will get this fixed.
- Discussion Forums
- » Help with Scripts
-
» A rather ambitious cloud Pong Project.