Skip to content

move rotate entities

Fosowl edited this page May 30, 2020 · 3 revisions

moving entities on the scene

you can teleport entities, make them move toward coordinate at a certain speed or move toward another entities or group of entities

teleport entities

teleport an entities on the scene.

void starset_entities_teleport(entities_t *entities, char *name , float x, float y);

parameter

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

char *name : the name of the entities to teleport.

float x : x coordinate to teleport the entities to.

float x : y coordinate to teleport the entities to.

move entities toward a point

move entities at a certain speed toward a point.

! the default speed for an entitie is 2 you can change this value by usingstarset_entities_get_propreties(..parameter..)->speed = new_speed

void starset_entities_move(entities_t *entities, char *name, float x, float y);

parameter

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

char *name : the name of the entities to move.

float x : x coordinate to move the entities to.

float x : y coordinate to move the entities to.

move entities to another

move an entities to another.

void starset_entities_move_to_other(entities_t *entities, char *first , char *second);

move an entities to another

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

char *name : the name of the entities to move to the other.

char *second : the name of the target entities to move to.

move entities from an angle

move an entities by following a constant angle.

void starset_move_from_angle(entities_t *entities, char *name, float angle , int speed);

parameter

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

char *name : the name of the entities to move from an angle.

float angle : the angle to move the entities with.

int speed : the moving speed.

rotate entities

rotate entities toward x,y coordinate.

float starset_entities_rotate_to(entities_t *entities, char *name , sfVector2f target);

parameter

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

char *name : name of the entitie to rotate.

sfVector2f target: coordinate of the point we want to rotate to.

rotate entities toward another

rotate entities toward another entities.

float starset_entitites_rotate_to_other(entities_t *entitie, char *name , char *name_other);

parameter

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

char *name : name of the entitie to rotate toward the other.

char *name_other : name of the entitie to rotate toward.

Clone this wiki locally