Discuss Scratch

Daring_Sailor
Scratcher
1000+ posts

How do I make a 'Logged in player?' mechanism?

lederniersamourai wrote:

deck26 wrote:

Drunken_Sailor wrote:

lederniersamourai wrote:

Remeber that if you want to extend that to players not in the “master” list of players, you will have two options:
1) a “master” player must be on-line to accept unregistered players
2) unregistered players can play between them without any “master” players

In both cases you must
a) communicate usernames into cloud variables. For that you must encode those names into digits because cloud variables do not accept letters.
b) synchronize every players in order that they have the full list of current players.

You will find solutions by exploring projects of others.

Have fun!

Couldn't I just:
when green flag clicked
if <not <[ invited usernames list v] contains [(username) ]>> then
add (username) to [ invited usernames list v]

end

Then do the ‘ping’ thing?
No point having the list in that case, just let anyone connect. Also the list would only be updated for that user - it's not in the cloud - so if the other players needed to know that player's name you'd have to encode and decode it to get them to see it.

I proposed the simple solution for a quick win for Drunken_Sailor
Today he understands quite well what happens and he can test his game with his friends.

The list is local for each user. So, you must initialise the list in the game in order for all palyers to get the same table for the identifiers.

At the very beginning, the scratch team planned to give a unique id to each scratcher (I guess it is the one used for your “scratch homepage”). Then they decided not do that.

In a number of projects, there are solutions for encod/decode of usernames and simulating lists in a cloud variable. Those solutions are more complicated to understand.
Inthe “explore” tab of the scratch website, just search for “encode”, or “decode”, of “top ranked” for cloud games.

Ok, I will! Thanks!

Also, how could I make it open to all Scratchers?
deck26
Scratcher
1000+ posts

How do I make a 'Logged in player?' mechanism?

lederniersamourai wrote:

I proposed the simple solution for a quick win for Drunken_Sailor ……….

I realised that but his subsequent question needed answering
Daring_Sailor
Scratcher
1000+ posts

How do I make a 'Logged in player?' mechanism?

Look! here is a link to the finished project, which I couldn't made without all of you guys!
https://scratch.mit.edu/projects/78746002/!

Powered by DjangoBB