Moving 2D array inside a 2D array

Hi guys,

A while back, I had a question about this little stub program.

http://www.cplusplus.com/forum/general/92801/

Now, I am trying to model "light" inside the world[20][20] char array by using
a char light[4][4] which only opens up the map in enclosed in the light area of effect. In this case 4x4. I have tried quite a few things, including 4D arrays, but nothing comes close.


Essentially, I want to be able to move the light[][] array freely inside the world[][] array centered at some arbitrary point.

Anyone have any ideas how to proceed with this?

Thanks,

Mike
I suggest that you have two worlds. On that is constant and the other which is modifiable and where you copy light to.

Now if you want to move light all you have to do is to copy the data from the constant world to the position where light currently resides and then copy light to the new positon. Refresh both areas
Thanks Coder777,

I ran out of time today, but I will give what you said a shot tomorrow after work.

Thanks,

Mike
Topic archived. No new replies allowed.