PDA

View Full Version : [AS3] Tile help


EightySeven
12-04-2008, 07:03 PM
hey ya'll. been trying to figure this out fer a while and its still not clicking for me.

all I want is for my guy to be able to determine which tile hes on. if hes on a ground tile i want himt to know "Hey i'm on a ground tile" if hes on some spikes i want it to know hes on some spikes.

From what I can tell the code has taken my code, which i will graphically depict as horizontal with the = sign, and has turned it to look like this ||

SO when u step off of 0,6 (ground) the next one should be 0,6(ground) BUT the code appear to be reading it at 6,0(ground) the next one 6,1 which is nothing. If u keep walking u hit the center line of ground and eventually the bottom ground. once u pass that your off the map and it throws errors.

I'm basing my code on this engine (http://www.emanueleferonato.com/2008/10/14/new-tile-based-platform-engine-as3-version-updated-to-step-10-plus-scrolling/#more-573) but Doing everything in 1 big'ol heap isn't my style so i'm trying to break it up and make it so i can work with it.

please feel free to fix any of my other poor programming, but please make a comment where u changed something.

fitz
12-05-2008, 04:17 PM
I took a look, and I did notice when you check under foot, you use "foot_y" as the first array index, when traditonally, coordinates are represented as x,y not y,x. I also noticed you seem to be moving the "player" as well as all the tiles, which seems odd. It seems like you might be making the whole thing harder than it needs to be though.

EightySeven
12-06-2008, 02:54 AM
thanks. In the morning I'll have a look at what ur talking about. I'mnot used to this tile based stuff :)