# Isometric scrolling - problem

**URL:** <https://forum.kirupa.com/t/isometric-scrolling-problem/84650>\
**Category:** Uncategorized\
**Created:** [March 29, 2005, 1:36pm UTC](https://forum.kirupa.com/t/isometric-scrolling-problem/84650 "2005-03-29T13:36:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icon](https://avatars.discourse-cdn.com/v4/letter/i/c6cbf5/32.png) [@icon](https://forum.kirupa.com/u/icon)\
**Post date:** [March 29, 2005, 1:36pm UTC](https://forum.kirupa.com/t/isometric-scrolling-problem/84650/1 "2005-03-29T13:36:20Z")

</div>

Having a brain freeze today. I’ve got a function which builds a tile map, nothing special.

Here’s some of the code:

```auto

function build(map) { 
_root.createEmptyMovieClip("game", 10); 
_root.game.attachMovie("chopper","chopper",5000); 
_root.game.chopper._x = 200 
_root.game.chopper._y = 100 
_root.game.chopper.onEnterFrame = handleFrame; 
game._x = startX; 
game._y = startY; 
for (i=0; i < mapH; i++) { 
	 for (j=0; j < mapW; j++) { 
		 _root.game.attachMovie("tiles", "tile_"+i+"_"+j, ++d); 
		 _root.game["tile_"+i+"_"+j]._x = (tileW/2)*(j-i); 
		 _root.game["tile_"+i+"_"+j]._y = (tileH/2)*(j+i); 
		 _root.game["tile_"+i+"_"+j].gotoAndStop(map*[j]+1); 
	 } 
} 
game.chopper.swapDepths(++d); 
} 

```

That’s nice and simple. I’ve a frame handler for the chopper mc, which handles which direction the chopper is moving in, and calls the following function:

```auto

function moveMap(x, y) { 
	 speed = 3; 
	 movx = x/speed 
	 movy = y/speed 
	 game._x -= movx; 
	 game._y -= movy; 
	 game.chopper._x += movx; 
	 game.chopper._y += movy; 
} 

```

Again nice and simple, I just can’t seem to get my head around how I would work out which tile the chopperis currently over.

Any pointers would be much appreciated !

I’m feeling pretty dumb over this one
