Now, when a user moves, only his/her position is sent back to the other users. The position of all users is not sent each time.
The messages sent to the browser are now:
- the list of all users as a return to the join_room event (you can send responses to events in socket.io)
- a "join_room" event sent when a new user joins the room
- a "user_moved" event when a user moved
- a "user_left" event when a user left the room
The GameScene tracks all these events and reacts accordingly.
Also, I made a number of refactoring in the classes and removed the GameSceneInterface that was useless (it was implemented by the LogincScene for no reason at all)
Previously, userid was generated by the "/login" route and passed along.
This commit completely removes the uuid "userid" (and disables the LoginController too and any Jwt check).
"userid" is replaced by the "socket id" of the connection.
So a user is now identified using a socket id, which is unique for a given connection.
- Create position and check if user is in position to switch in the next scene.
- When scene is load, we load all scene in the layer of name "exit".
- Layer "exit" of map.json have a parametter "exitSceneKey" to identify next scene.
- Add layer "start", the player could start in the scene on the object present in the layer of name "start".
The "frame" variable actually contains a string pointing to the character selected.
It has nothing to do with a frame which is usually a particular image in an animation.
I'm renaming the variable accross the application to avoid confusion.
This PR adds the display of a circle around groups. This is useful to view where you need to go to speak to someone but also to debug.
Note: implementation is suboptimal, relying on a "graphics" object that is known to be slow. In the future, we need to use a circle as a sprite instead.