10 years ago by susnick
Hello, I am trying to access the screen from a function i created in main.js.
goToCoordinate: function() {
this.screen.x = (this.currentTile.x-1) * 64;
this.screen.y = (this.currentTile.y-1) * 64;
},
Screen is undefined and so is currentTile. currentTile was created just above the init portion of main.js.
MyGame = ig.Game.extend({
mouseLast: {x: 0, y: 0},
mapSize: {x: 250, y: 250},
currentTile: {x: 1, y: 1},
// Load a font
font: new ig.Font( 'media/consolasfont.png' ),
init: function() {
If someone could assist it would be much appreciated.
goToCoordinate: function() {
this.screen.x = (this.currentTile.x-1) * 64;
this.screen.y = (this.currentTile.y-1) * 64;
},
Screen is undefined and so is currentTile. currentTile was created just above the init portion of main.js.
MyGame = ig.Game.extend({
mouseLast: {x: 0, y: 0},
mapSize: {x: 250, y: 250},
currentTile: {x: 1, y: 1},
// Load a font
font: new ig.Font( 'media/consolasfont.png' ),
init: function() {
If someone could assist it would be much appreciated.