Hi,
I came from a C++ background. Usually in C++, I manipulate the "dynamic" objects creation/destruction using NEW and DELETE operator. I just need to specifiy an object type (class), and it will return an instance reference to it.
I am wondering how DBpro programmer create object in their game dynamically. Unlike C++, DBpro create each object by specifiying a numerical reference; C++ return an object reference.
In C++, if there are number of objects of different type, I will just store it in several array with different type (class). The array is not restricted to a fixed size, it can "grow".
What I am currently do in DBpro initially is, whenever I want to create an object dynamically, I just create a FOR loop from 1 to 65535 and look for an empty slot using OBJECT EXIST command. Then I realize by using this, I have no way to identify the object type later, i.e. how do I know Object 1 is Enemy Ship A, Object 4 is Capital Ship #2, and so on.
Then I try a different approach. I allocate a range of numbers of each object type, i.e. 1 to 100 for Enemy type A, 110 to 200 to Ship Type B, and so on. Whenever I want to create a new ship in the game dynamically, I just go through the appropriate range depends on the type, and look for a empty slot by using OBJECT EXIST command.
How about you guys? How do you manage and manipulate your objects in your game via DBpro?
Thanks!
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.
http://www.badnose.com/