Re: [Flashcoders] Storing x and y in a bytearray

2009-03-31 Thread Steven Sacks
http://polygonal.de If you want to learn about maximum optimization for collision detection, etc. nobody knows more than this guy. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

[Flashcoders] Storing x and y in a bytearray

2009-03-30 Thread Jiri
I have a byte question. I have to store a walkable area so a character 'knows' where it can walk or not. Currently I am using a multi-dim array based on the x and y pos of the tiles . so [[1],[0],[1]..etc] where pos(0,0) = array[0][0] = 1 (walkable) I was wondering if I could store this

Re: [Flashcoders] Storing x and y in a bytearray

2009-03-30 Thread Jiri
Good point, i can use getPixel to retrieve the color value and based on that 'know' if it is walkable. Cheers. Jiri Hans Wichman wrote: Hi, why not use an image? Eg use an image that represents your area, lookup the pixel values, AND them and decide what you can or cannot do in that area.

Re: [Flashcoders] Storing x and y in a bytearray

2009-03-30 Thread Jiri
On stage there is a draw shape. I copy it to BitmapData and use the transparancy for testing walkable or not. So i dont use compressed image format, just raw bitmap data. Or am i missing something? Jiri Hans Wichman wrote: yup exactly, only thing is that I'm not sure how detailed this info

Re: [Flashcoders] Storing x and y in a bytearray

2009-03-30 Thread Hans Wichman
ah no then you'll be fine ! Although if it's just a simple shape, hittest will work as well of course, depending on the performance you need. On Mon, Mar 30, 2009 at 1:52 PM, Jiri jiriheitla...@googlemail.com wrote: On stage there is a draw shape. I copy it to BitmapData and use the

Re: [Flashcoders] Storing x and y in a bytearray

2009-03-30 Thread Hans Wichman
yup exactly, only thing is that I'm not sure how detailed this info can be when using compressed image formats... On Mon, Mar 30, 2009 at 1:13 PM, Jiri jiriheitla...@googlemail.com wrote: Good point, i can use getPixel to retrieve the color value and based on that 'know' if it is walkable.

Re: [Flashcoders] Storing x and y in a bytearray

2009-03-30 Thread Jiri
Hittest is to expensive, i try to avoid it at all times. J Hans Wichman wrote: ah no then you'll be fine ! Although if it's just a simple shape, hittest will work as well of course, depending on the performance you need. On Mon, Mar 30, 2009 at 1:52 PM, Jiri jiriheitla...@googlemail.com

Re: [Flashcoders] Storing x and y in a bytearray

2009-03-30 Thread Hans Wichman
Hi, why not use an image? Eg use an image that represents your area, lookup the pixel values, AND them and decide what you can or cannot do in that area. greetz JC On Mon, Mar 30, 2009 at 12:41 PM, Jiri jiriheitla...@googlemail.com wrote: I have a byte question. I have to store a walkable