We are excited to introduce our javascript SDK for AppWarp. This will allow developers to quickly build engaging real-time multiplayer HTML5 games and apps. Our javascript SDK uses websocket technology for fast asynchronous communication with other clients through the cloud. This is better as it does away with the inconvenient AJAX polling paradigm and doesn’t require any browser plugin to be installed. Read more benefits about websockets here. In a nutshell, it means your network communication layer is lightweight and fast.
Since AppWarp server supports connections from android, ios, wp7, j2me and now websockets – communication is truly cross-platform. This means users playing the browser flavor of your game can interact in real-time even with users who are on the corresponding native flavors.
Currently the Javascript SDK supports Firefox and Chrome browsers. We will soon add support for the to be released IE 10 browser.
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.
2 Comments
hey hi can u help me? I just wanted to kn like if I have 2 ppl logged in a room and if I want to send the details (his name) of first player to the second player (so that I can see both players names on the ui of both the browser windows in my gameplay) and vice versa which notification method should I use updatePeers or sendUpdate(update) and how ?
Shantanu, you can use sendUpdate() since you only want to send names which is nothing but strings.