Code:
//-------------------
typedef struct
{
int height;
int weigh;
char name;
ENTITY* player_01_ent;
void setPan(var newPan) {player_01_ent->pan = newPan;}
} PLAYERS;
//Reset variable from structures
PLAYERS* player_01_str = { height = 0; weigh = 0; name = "NULL"; }
//testing entitys on structures
function ball_life()
{
player_01_str.player_01_ent = my;
player_01_str.setPan(90);
}
This works in C++ (not tested, but it should work), but I'm not sure this is allowed in lite-C or even C..
You might think the syntax of struct.entity.pan = value is easyer, but personally I prefer the struct.setMember(value) syntax because it allows you to check the input. Basically you can set rules INSIDE the object (not everywhere you use it) how it may be used. For example, if you only want pan values 0 to 180 to be allowed, you could add a check for that in the setPan() function.