How do I reset multiplayer/room

0 favourites
  • 10 posts
From the Asset Store
Add calm and a lounge vibe to your games with these 8 tracks
  • Hi there,

    So I am playing around with the Pong multiplayer example, trying to extend it and such.

    I have made a lobby where you can change name but also profile picture, etc. There is a button to play a game, which takes you to the game layout.

    You can play the game and after 5 points, you win, and are taken back to the menu layout/lobby.

    However if you press to play again, you are taken straight back to the lobby from the game because the game thinks you have still won from last time. how do i reset this? i have tried using multilayer commands such as disconnect, leave room but this is not having any effect.

    thank you for guidance!

  • It sounds like you need to reset the variables with scores upon entering the lobby.

  • hi lennaert, thanks for your reply, but which variables do i reset and how?

    do i need to also disconnect from the room or signalling server? i am guessing and trying many combinations of variable deleting and leaving room but still yet no success.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The variable with the score which makes you win, I would guess setting it to zero could do it.

    But without your capx its uncertain to say whats happening.

  • lennaert i am using the multiplayer pong capx that comes with construct2

    the score is associated with each paddle. i dont understand though how the score is retained after disconnecting from the signalling server???

  • There is no way to tell without knowing what you changed

  • okay i have discovered that after finishing the game, you need to reset the global variable "game state" to waiting.

    now i can restart a new "game" (game layout) but still am unable to join a new room for some reason

  • Leaving the room, and going back to the lobby to join a new room would be the way.

  • hi lennaert thank you for your replies, but then where should the code be for connecting to the signalling server? in the default pong project, this is in the "game" layout so does that mean that at the end of each game i should disconnect from the server? or just the room as you have mentioned?

  • Say, how did you get it to go to the lobby, or what was your method? Because some weird stuff is happening to mt game.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)