   Coordinate system
  What is the best way to make a coordinate system on a small 2D enviroment.Im making a small virtual pet simulation and i want my "Pet" to be able to move around.Im thinking of a grid size of 1000x1000 and with a few objects that the pet can interact with.the two models I'm torn between is if the coordinates is stored by the objects themselves and then go through them in sequens and se if their coordinates match the coordinates I'm looking for.The other is if I make a 2D vactor with pointers, pointing to the diffrent objects.I'm working in C++, don't know if any of these approaches are any good. Please lend me you guidance.   
  I am not sure the scope of your game but you should be considering a few things.Personally, I am using essentially a grid full of 'tiles' which hold pointers to whatever objects can walk on them, but that works well for me because movement and such is all tile based.Can objects be at intermediate values such as 500.52, 301.29 or is it whole numbers only where the object 'snaps' to the next point?I think the model (if I am understanding it) where each 'pet' has a pointer to every object probably wont work too well because the 'pet' shouldn't keep track of every object, even those way too far away.  Also, if you plan for expansion (i.e., a bigger world) it would begin to get more difficult to maintain.   ;  The pet will snapp to diffrent possition. The pet will have its coordinates in two ints and the program will do a collision detection of some kind. The objects will be small structs. It would be nice if it would scale easily.   ;  Storing positions per-object should work fine, really. Once you start working with large numbers of objects, you may want to look into some kind of space partitioning, such as a grid or quadtree, but you probably won't need that for now.   ;  Yeah, I probably wont need it for this but im not making this cuz i think its gona be good. I'm making it cuz I need to learn. I'll look into what you just said. Thanks   