Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

8 years ago by ShawnSwander

So the game I'm working on has a layer of isometric tiles over a regular square layer so its only partly isometric.

I want to use entities for the isometric tiles because there can't be many on my screen at once so I don't think it'll hurt me too bad. Drawing large maps by hand seems too tedious.

So here is my idea...

I want to just run a for loop and get the data from a weltmeister map then according to the tile used at the appropriate location I will spawn an entity such as an isometric door or wall. Problem is I don't know how to call a specific map layer (besides colission layer)
is it possible to do something like this?

8 years ago by Hareesun

This shouldn't really be in the Code section as you've not posted any code. The Help section would be better suited.

BUT. This is an interesting idea, and I'll see if I can put a demo together. :)

8 years ago by ShawnSwander

I know I wanted to delete it but I didn't see an option. So when I get it right I'll post it this code is really close but I get an error "Uncaught TypeError: Cannot read property '0' of undefined" I know this is really close to working.
Note HEX_SIZE is a constant set to your tile size spacing. so if they are 55 pixels apart HEX_SIZE = 55

This is pretty close to what I'm goin for. Let me know if it has any problems for you.
tiles = ig.game.getMapByName('hexes');
            for (y in tiles.data){
               for (x in tiles.data){
                  switch (tiles.data[y][x]){
                     case 13:
                        settings = {name:13} 
                        ig.game.spawnEntity(EntityIsomap,x*HEX_SIZE,y*HEX_SIZE,settings);
                     break;
                  }
               }   
            }
Page 1 of 1
« first « previous next › last »