Code: Select all
//global variables I dont really wanna use but dont know how to solve it without
var screenPix = 0;
var screenTiles = 0;
var MapArray = new Array();
MapArrayFunc: function(){
screenPix = ig.system.realWidth * ig.system.realHeight;
screenTiles = screenPix / 32;
MapArray = new Array();
for (i=0; i<=screenTiles; i++){
MapArray[i]++;
};//for end
},//MapArrayFunc end
draw: function() {
// Draw all entities and backgroundMaps
this.parent();
//map array test[code]this.font.draw(screenTiles, 50, 60);
this.font.draw(MapArray[0], 50, 50);
}//draw end
[/code]
Code: Select all
The output is 0
0I've have changed it to:
Code: Select all
//Only 1 glob var left
var MapArray = new Array();
MapArrayFunc: function(){
screenX = 0;
screenY = 0;
for (i=0; i=(ig.system.realWidth*ig.system.realHeight)/32; i++){
MapArray[screenX,screenY];
screenX+32;
screenY+32;
};//for end
},//MapArrayFunc end
draw: function() {
// Draw all entities and backgroundMaps
this.parent();
//map array
this.font.draw(screenPix, 50, 50);
this.font.draw(screenTiles, 50, 60);
this.font.draw(MapArray[0,1], 50, 50);
}//draw end