This site requires JavaScript, please enable it in your browser!
Greenfoot back
349592576
349592576 wrote ...

2021/6/8

Multiplayer Board Game

349592576 349592576

2021/6/8

#
Hi, could anyone please help provide some guidance / an exemplar on how to pass information between users? I am building a board game, and I would like to implement a way for two players to play against each other online, passing moves between each other, similar to how others have built messaging systems.
danpost danpost

2021/6/8

#
Will each user be allowed to have multiple games in progress with multiple users at the same time? If not, the coding is much simplified (yet, still not easy). Also, what are your intentions of the usage of UserInfo data (if you have any, yet)?
349592576 349592576

2021/6/9

#
As of right now, I think each user will only be able to have one game going at a time. I'm planning on using the UserInfo scoring ability to assign every user a serial number. I am thinking about using the multipurpose strings to pass moves between the users.
danpost danpost

2021/6/9

#
349592576 wrote...
I'm planning on using the UserInfo scoring ability to assign every user a serial number
That sounds like overkill. Each user already has a unique name. Also, I think a better use of the score field would be to track who is playing who. That is, when two players start a game, take a unique game number and make it the score field for both players. That way, you can use getNearby to quickly find an opponent as well as for checking for unique game numbers.
You need to login to post a reply.