Multiplayer Games in HTML5 with Typescript – AppWarp

We’ve released a newer version of our HTML5/JS SDK for AppWarp Multiplayer gaming platform. The new SDK involves some major changes.

One of the major changes is the support for Typescript. Typescript makes writing class-based object oriented JavaScript programs easy. As part of the SDK, you will also get the corresponding appwarp.d.ts file which you can use while working with TypeScript.

Another major change is the way the listeners are defined and used. Now instead of objects, function callbacks are used to listen to the events. Simply define listeners and register them with their corresponding event Id.

1
2
3
4
5
6
7
8
9
10
11
12
13
 function onConnectDone(res)
{
} 
 
function onChatReceived(chat)
{
}
 
var _warpclient;
AppWarp.WarpClient.initialize(apiKey, secreteKey);
_warpclient = AppWarp.WarpClient.getInstance();
_warpclient.setResponseListener(AppWarp.Events.onConnectDone, onConnectDone);
_warpclient.setNotifyListener(AppWarp.Events.onChatReceived, onChatReceived);

To play with our new SDK, we have created a basic chat application which you can launch by clicking here. The full tutorial with source code is available here.

chat 1 Multiplayer Games in HTML5 with Typescript   AppWarp

Another major change is the introduction of AppWarp namespace. All the functions, constants and classes are defined inside ‘AppWarp’ Namespace. The WarpClient is now a singleton class, so you must use getInstance() to get the instance.

1
2
3
var _warpclient;
AppWarp.WarpClient.initialize(apiKey, secreteKey);
_warpclient = AppWarp.WarpClient.getInstance();

All the events i.e. responses and notifications are declared under ‘AppWarp.Events’ namespace.

To learn more about AppWarp SDK visit the HTML5 Dev Center, and you can send us your queries at support@shephertz.com

twitter Multiplayer Games in HTML5 with Typescript   AppWarpfacebook Multiplayer Games in HTML5 with Typescript   AppWarpgoogle Multiplayer Games in HTML5 with Typescript   AppWarplinkedin Multiplayer Games in HTML5 with Typescript   AppWarppinterest Multiplayer Games in HTML5 with Typescript   AppWarpreddit Multiplayer Games in HTML5 with Typescript   AppWarpstumbleupon Multiplayer Games in HTML5 with Typescript   AppWarptumblr Multiplayer Games in HTML5 with Typescript   AppWarp

Leave a Reply

Your email address will not be published. Required fields are marked *


9 + = eighteen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>