-
Notifications
You must be signed in to change notification settings - Fork 9
Javascript sample walkthrough
A simple example is provided to help you in getting started. It is a simple version of the classic Tag game. Once you’ve entered a name and joined the virtual world – you are asked to pick an environment. In the backend – these are actually different virtual rooms created from AppHq. The first user to join a room is given the role of a policeman and the second one to join is given the role of a robber. The number of users in the room is easily determined using the getLiveRoomInfo api and by tracking the onUserJoined/LeftRoom events exposed from the SDK. Once the robber has joined, the game starts and the policeman is given 60 seconds to catch the thief. Both endpoints pass each other their coordinates through the updatePeers api using which they can track the others positions on their user interface. Once the thief detects that the policeman’s coordinates overlap with his own – the game gets over.