I've created this data structure for use with entities that will have a special "magnetism" property:
Code:
typedef struct MAGNET
{
ENTITY* entity;
ENTITY* opt1,opt2;
bool pole;
}MAGNET;
Now I need to be able to create many of these (they will be visible physics entities, so it needs to work like ent_create). How would I achieve this?
I was thinking that it would be a function that would return a MAGNET*, kinda like this:
Code:
MAGNET* mag_create(STRING* filename,VECTOR* pos)
{
...(no idea how an of this would work)...
return [whatever wierd MAGNET pointer this thing would spit out];
}
So, does ne1 have any ideas?