• Content Count

  • Joined

  • Last visited

  1. I'm fairly new to Phaser 2 and using Local Storage. I am getting errors when parsing my levels array. 0 is unlocked, 1 is locked. Unlocking the first 2 levels works great with Local Storage. When unlocking level 3 and refreshing the page, I get the following error: "Unexpected token , in JSON at position 1" in the boot.js file: if (JSON.parse(localStorage.getItem(game.global.localStorageName)) === null) { localStorage.setItem(game.global.localStorageName, JSON.stringify(game.global.levelsArray)); } else { game.global.levelsArray = JSON.parse(localStorage.getItem(game.global.localStorageName)); } Setting local storage after completing a level: if (game.global.levelsArray[game.global.level] == 1 && game.global.level < game.global.levelsArray.length) { game.global.levelsArray[game.global.level] = 0; localStorage.setItem(game.global.localStorageName, JSON.stringify(game.global.levelsArray)); } Initial global variables in game.js game.global = { levelsArray: [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,], level: 0, localStorageName: 'savedLevels' } Thanks!
  2. Someone did a good blog post on integrating javascript libraries into Visual Studio Code: http://www.johnpapa.net/intellisense-witha-visual-studio-code/ There are some good tips here, but alas, these tips did not seem to work for Babylon.js. I know nothing about VS but this blog post seems a good step in the right direction for Babylon.js users in using Visual Studio Code.
  3. Hi all, I am having trouble getting Intellisense to work with Babylon.js as well in Visual Studio Code. The reference path for Babylon.js is there but it has the red squiggly line underneath and says no definition found. For the term "BABYLON" it puts a green squiggly line underneath. At this point a light bulb should appear underneath the green squiggly and I should be able to click on the light bulb and add the reference path to the Babylon library, but am not getting that option. I am editing on a Mac (and Windows) so I would love to have the Intellisense feature on both machines! Thanks!