Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Cloud User Connection list
- pacificapilot
- Scratcher
100+ posts
Cloud User Connection list
I am building a multiplayer game and need a way to detect when someone is no longer on the project. I have a script set up to detect new players and add them to the list, but no way to detect when they leave. (See inside “Cloud” sprite) PROJECT
====================================================================
====================================================================
- axus-
- Scratcher
64 posts
Cloud User Connection list
PROJECTI don't know much about cloud variables but I would think that you would want to have some sort of sweeping feature. I mean that after every 20 seconds or so it refreshes the list. Hope that helps… I am building a multiplayer game and need a way to detect when someone is no longer on the project. I have a script set up to detect new players and add them to the list, but no way to detect when they leave. (See inside “Cloud” sprite)
paddle robs banks in his spare time uh.. d-donations yeahWhat the heck is DDCC18? https://scratch.mit.edu/discuss/topic/300290/
- deck26
- Scratcher
1000+ posts
Cloud User Connection list
You can only reliably detect someone leaving the project by having the other instances of the project detect that they've gone - if they lose their connection or close the browser the user disconnecting cannot tell Scratch they're doing so. The usual method is to see whether whatever the disconnecting player is controlling is still changing.
Here's the method I prefer - https://scratch.mit.edu/projects/77775784/
Here's the method I prefer - https://scratch.mit.edu/projects/77775784/
- pacificapilot
- Scratcher
100+ posts
Cloud User Connection list
That is exactly what I needed. Thanks for the help You can only reliably detect someone leaving the project by having the other instances of the project detect that they've gone - if they lose their connection or close the browser the user disconnecting cannot tell Scratch they're doing so. The usual method is to see whether whatever the disconnecting player is controlling is still changing.
Here's the method I prefer - https://scratch.mit.edu/projects/77775784/
====================================================================
====================================================================
- Discussion Forums
- » Help with Scripts
- » Cloud User Connection list