Need Some help with Isometric level
- djoecks
-
djoecks
- Member since: May. 26, 2013
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
ok, so I am new with this whole game development stuff with AS3 however i am learning. I understand the basics of arrays as I have been doing nothing than learning it the last few months. Came across as3isolib to help and unfortunately, not many tutorials on that anymore but I just want to get a level made in isometric view. That said, I am having a hard time wrapping my brain around how to get the iso view. I just dont have any updated examples to view regarding this. Unfortunately, not many tutorials on that on youtube or other places. I know the concepts are out there but actually viewing and understand it is something else. If anyone can help, please let me know. Been driving myself crazy the last few months. Thanks.
- MSGhero
-
MSGhero
- Member since: Dec. 15, 2010
- Offline.
-
- Forum Stats
- Supporter
- Level 16
- Game Developer
IsoView is a displayobject, so you just addChild it like any other sprite or mc. IsoView.addScene() adds an IsoScene, which holds IsoEverythingElse. The scene is the main "iso logic" handler where you add IsoBox, etc to; and the view lets you see what's going on inside each scene.
- djoecks
-
djoecks
- Member since: May. 26, 2013
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
At 7/29/13 10:18 PM, MSGhero wrote: IsoView is a displayobject, so you just addChild it like any other sprite or mc. IsoView.addScene() adds an IsoScene, which holds IsoEverythingElse. The scene is the main "iso logic" handler where you add IsoBox, etc to; and the view lets you see what's going on inside each scene.
well, what im saying is the whole array thing for the map. Some tutorials I have done i have gotten but i am having a hard time with making an array to where the isosprites are in the right location in the map array. Dont know why i am having such a hard time because it should be somewhat easy to do but i dont know.
- MSGhero
-
MSGhero
- Member since: Dec. 15, 2010
- Offline.
-
- Forum Stats
- Supporter
- Level 16
- Game Developer
At 7/30/13 09:47 AM, djoecks wrote: well, what im saying is the whole array thing for the map. Some tutorials I have done i have gotten but i am having a hard time with making an array to where the isosprites are in the right location in the map array. Dont know why i am having such a hard time because it should be somewhat easy to do but i dont know.
So what's the issue? If your sprites are in the wrong spots, you need to iterate through the array differently. If you have two for loops, i and j, you access each element by array[j][i]
If that doesn't work, look how your sprites are oriented and rotate the array or your logic.
- djoecks
-
djoecks
- Member since: May. 26, 2013
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
So what's the issue? If your sprites are in the wrong spots, you need to iterate through the array differently. If you have two for loops, i and j, you access each element by array[j][i]
If that doesn't work, look how your sprites are oriented and rotate the array or your logic.
ok, i understand. I will see what I can do and see if I can get it to work. Thanks for your help.
- djoecks
-
djoecks
- Member since: May. 26, 2013
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
ok, so heres my issue. I am trying to make the level the way I want it. I have been wrecking my brain literally for months figuring out arrays and all that and the as3isolib as well. I have done the tutorials and obviously i have picked up on some things and I understand the for loops and stuff somewhat but for some reason I am having a hard time with it actually working and I know its something I am doing for sure. Problem is I dont know what it is. I have a feeling its getting the map array to function with the isoSprites the right way but I dont know how to do that.
package
{
import as3isolib.display.IsoSprite;
import as3isolib.display.IsoView;
import as3isolib.display.scene.IsoGrid;
import as3isolib.display.scene.IsoScene;
import as3isolib.geom.Pt;
import flash.display.Sprite;
[SWF(width="800", height="600", backgroundColor="#000000", frameRate="30")]
public class game extends Sprite
{
private static const CELL_SIZE:Number= 50;
private var grid:IsoGrid;
private var scene:IsoScene;
private var view:IsoView;
public function game()
{
grid = new IsoGrid();
grid.setGridSize(8,8,1);
grid.showOrigin = false;
grid.cellSize = CELL_SIZE;
scene = new IsoScene();
scene.addChild(grid);
var myMap:Array = [
[1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,0,0,],
[1,0,0,0,0,0,1,1,],
[1,0,0,0,0,0,1,0,],
[1,0,0,1,0,0,1,0,],
[1,0,0,1,1,1,1,0,],
[1,0,0,0,0,0,0,0,],
[1,1,1,1,1,1,1,1,]
];
var iso:IsoSprite
for(var i:int=0; i<8; i++)
{
for(var j:int=0; j<8; j++)
{
iso = new IsoSprite();
iso.moveBy(j*50, i*50, 0);
iso.sprites[brick,grass];
}
}
scene.render();
view = new IsoView();
view.setSize(800,600);
view.centerOnPt(new Pt(200,200,0));
view.addScene(myMap[j][i]);
addChild(view);
}
}
}
- djoecks
-
djoecks
- Member since: May. 26, 2013
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
ok, i have finally figured it out. Now on to an actual player....

