I have been following kirupa.com - RPG Programming: Tiles tutorial but have been applying it to my program rather than copying it.
I have hit a problem with the collision detection
[SIZE=2][COLOR=black][FONT=Arial][SIZE=2]guyTL = root["tile"+Math.floor((x-(_parent._width/2)+1)/root.tileWdth)+"“+Math.floor((y-(_parent._height/2)+1)/_root.tileHght)].barrier; guyTR = root["tile”+Math.floor((x+(_parent._width/2)-1)/root.tileWdth)+"“+Math.floor((y-(_parent._height/2)+1)/_root.tileHght)].barrier; guyBR = root["tile”+Math.floor((x+(_parent._width/2)-1)/root.tileWdth)+"“+Math.floor((y+(_parent._height/2)-1)/_root.tileHght)].barrier; guyBL = root["tile”+Math.floor((x-(_parent._width/2)+1)/root.tileWdth)+""+Math.floor((y+(_parent._height/2)-1)/_root.tileHght)].barrier;
[/SIZE][/FONT][/COLOR][/SIZE]
The result of these always return as undefined, the reason is that I have placed my code in a different place than the tutorial advises - frame one rather than the movie clip so I think the problem lays in the relative adressing such as _parent.
I need help trying to figure out what to edit in order for this code to return the correct true/false values for the collision detection.
my guy is attached in _root.itemsMC and called Ship_MC
the tiles are attached in _root.tiler