what is the best way for using a grid based system- to map out a grid of objects, or to just make a list of grid points?
Specifically in relation to how and where a self generating class would produce new instances on the grid.
JB
what is the best way for using a grid based system- to map out a grid of objects, or to just make a list of grid points?
Specifically in relation to how and where a self generating class would produce new instances on the grid.
JB
Just make each grid be 1 Panda3d Unit
then use Vec3(123,232,0) to set the objects.
If you need a map make each tiles be 1x1 Unit and be centered.
Dont forget to flatten strong after you load the map of tiles.
How to you reprecent storage?
I recommend storing map in a text file:
~~~~~^~^~^~~^~~~
~~~~~~~^~~~~^^~~
~~~~~~~~~~~~~^~^
~~TTTTTTTT~~~^~~
~~T~~~~~~T~~~~~^
~~T~~~~~~T~~~^~~
~~TTT~~TTT~~~~~~
~~~~~~~~~~~~~^~~
~~~~~~~~~~~~~~~~
You can store other objects by name
objects["Blue Wizzard"] = Wizzard(pos=(34,3),level=86)
Or by position hash
objects[(43,3)] = Wizzard("Blue Wizzard", level=86)
Or both.
Is there a example you could point me to that shows this in action?
Thanks JB
I have it now- at least for 2d.
I load the text into a list, each item on the list holds an entire row so then I loop through the list, then loop through the row items and do a simple if item==character test and then create the matching object.
JB Skaggs