VgaGames4

VgaGames4 - miscellaneous man-pages

[.. upper level ..]

# vg4->misc->moving_one_step_to_dst()

Get positions when moving to a destination point.

SYNTAX
int vg4->misc->moving_one_step_to_dst(const struct VG_RectCent *rectc_start, const struct VG_Point *pt_dest, int factor, struct VG_RectCent **rectc_pos)
FUNCTION PARAMETERS

rectc_start | Starting position
pt_dest | Destination point (centered)
factor | Positive factor in 1/10 pixel to multiply moving
rectc_pos | For returning allocated array with moving positions, must be freed with free()

RETURN VALUE
Returns the number of elements in rectc_pos, or 0 = destination reached
DESCRIPTION
Get positions when moving to a destination point. The pt_dest is the destination point to seek, which will not be exceeded. The factor controls the velocity. A factor of 1 would move the object 1/10th pixel. This function can be combined with vg4->misc->move_and_check_collisions().
SEE ALSO
vg4->misc->moving_one_step() vg4->misc->move_and_check_collisions() vg4->misc->points_on_line()