Skip to content

looping entities getting entitie properties

Fosowl edited this page May 30, 2020 · 2 revisions

looping entities and getting entitie propreties

get single entities pointer

use this to get an entities pointer by its name, usefull in many case

entities_t *starset_entities_get_propreties(entities_t *entities, char *name);

parameter

entities_t *entities : the chain list of all entities on the scene.

char *name : name of the entities to get.

loop entities one by one

allow you to loop on each entities.

entities_t *starset_get_next(entities_t *entities, char *name);

parameter

entities_t *entities : the chain list of all entities on the scene.

char *name : the class of the entities you want to iterate to, put NULL if you want to iterate on every entities of the scene.

get closest entities

get the closest entities to another.

entities_t *starset_get_closest(entities_t *entities, char *name);

parameter

entities_t *entities : the chain list of all entities on the scene.

char *name : the name of the entitie of witch you want to get the closest entities.

get distance between 2 entities

measure distance between 2 vector.

int starset_get_distance(sfVector2f vector_1, sfVector2f vector_2);

parameter

sfVector2f vector_1 : first sfVector2f

sfVector2f vector_2 : second sfVector2f

Clone this wiki locally