C
charly
Greetings,
I am trying to make an app simulating ants running on the map.
I am wondering about the best way to solve the "map" problem.
so far, I' ve decided to create a vector which would hold each cell as a
Cell object (x,y,type of ground, content)
Is this ok ?
When calling the draw method of the map, i would use an iterator to draw
each cell, according to its content.
When a ant is in a square, a copy of herself is put in the content of
the square (so 2 ants can detect that they are in neighbouring cells
because each time a ant moves in a square, she looks around her ) and
removed from the previous square.
All ants are stocked in another vector.
I iterate all ants each time the global thread is awoken and run the act
method of each ant (changing its coordinates....).
Has someone have any ideas how I could improve or change the way I did
things so far ?
Many thx !
I am trying to make an app simulating ants running on the map.
I am wondering about the best way to solve the "map" problem.
so far, I' ve decided to create a vector which would hold each cell as a
Cell object (x,y,type of ground, content)
Is this ok ?
When calling the draw method of the map, i would use an iterator to draw
each cell, according to its content.
When a ant is in a square, a copy of herself is put in the content of
the square (so 2 ants can detect that they are in neighbouring cells
because each time a ant moves in a square, she looks around her ) and
removed from the previous square.
All ants are stocked in another vector.
I iterate all ants each time the global thread is awoken and run the act
method of each ant (changing its coordinates....).
Has someone have any ideas how I could improve or change the way I did
things so far ?
Many thx !