Skip to content

Commit

Permalink
fixed multi-touch demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlb committed Dec 18, 2013
1 parent 4040ece commit 81fd6d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion games/real-time-multi-touch/pubnub.htm
Expand Up @@ -8,6 +8,6 @@
<meta name=apple-mobile-web-app-status-bar-style content=black-translucent>
</head><body><div id=screen><div id=painter></div></div></body>
<div id=pubnub></div>
<script src=http://cdn.pubnub.com/pubnub-3.1.min.js></script>
<script src=http://cdn.pubnub.com/pubnub.min.js></script>
<script src=pubnub.js></script>
</html>
7 changes: 3 additions & 4 deletions games/real-time-multi-touch/pubnub.js
@@ -1,12 +1,11 @@
(function(){


// ---------------
// Utility
// ---------------

var db = this['localStorage']
, PUB = PUBNUB
, PUB = PUBNUB.init({})
, now = function(){return+new Date}
, cookie = {
get : function(key) {
Expand Down Expand Up @@ -132,15 +131,15 @@ var players = (function(){

function current_player(ready) {
function is_ready() {
if (player['uuid'] && player['joined']) {
if (player && player['uuid'] && player['joined']) {
players.add(player);
ready(player)
}
}

var player = {
'uuid' : PUB.uuid(function(uuid){
player['uuid'] = uuid;
//player['uuid'] = uuid;
is_ready();
}),
'joined' : PUB.time(function(time){
Expand Down

0 comments on commit 81fd6d0

Please sign in to comment.