diff options
Diffstat (limited to 'demos/declarative/snake/content/snake.js')
-rw-r--r-- | demos/declarative/snake/content/snake.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js index 02f9757..f5c231e 100644 --- a/demos/declarative/snake/content/snake.js +++ b/demos/declarative/snake/content/snake.js @@ -52,15 +52,14 @@ function startNewGame() link.spawned = false; link.dying = false; } else { - if(linkComponent.isReady == false){ - if(linkComponent.isError == true) + if(linkComponent.status != Component.Ready) { + if(linkComponent.status == Component.Error) console.log(linkComponent.errorsString()); else console.log("Still loading linkComponent"); continue;//TODO: Better error handling? } - var link = linkComponent.createObject(); - link.parent = playfield; + var link = linkComponent.createObject(playfield); link.z = numRows * numColumns + 1 - i; link.type = i == 0 ? 2 : 0; link.spawned = false; @@ -293,15 +292,14 @@ function createCookie(value) { } } - if(cookieComponent.isReady == false){ - if(cookieComponent.isError == true) + if(cookieComponent.status != Component.Ready) { + if(cookieComponent.status == Component.Error) console.log(cookieComponent.errorsString()); else console.log("Still loading cookieComponent"); return;//TODO: Better error handling? } - cookie = cookieComponent.createObject(); - cookie.parent = head.parent; + cookie = cookieComponent.createObject(head.parent); cookie.value = value; cookie.row = row; cookie.column = column; |