Drawing Smooth Curved Line (Path) When User Touch Screen On Touch Event (Like Flight Control Game)

I want to draw smooth line when user touch the screen , drawing line between two points or more (taken from event.x and event.y ) will produce jagged line , i want to create path with smooth curves like (Flight Control Game or Air Control)

thanks in advance [import]uid: 74537 topic_id: 15093 reply_id: 315093[/import]

Bezier Curves are good for that. :slight_smile: [import]uid: 12822 topic_id: 15093 reply_id: 55834[/import]

Thank you Yobonja …

i have test Bezier Curves but its not make the line smooth as required when drawing line between points that taken from touch event depends also on on the speed of touch points number may decreased when speed of touching increased also i have problem on the speed of object when moving it on specific path …

i hope to have some code sample if anyone make something like that before [import]uid: 74537 topic_id: 15093 reply_id: 55837[/import]

look up on code exchange, there are some samples that can help you.

one is to reduce the number of points in a line and the other one if bezier curves as @Yononja mentioned you can try to use.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 15093 reply_id: 55843[/import]

in code exchange you can use the camull-spline curve fitting algorithm

http://developer.anscamobile.com/code/curve-fitting-catmull-spline

c

[import]uid: 24 topic_id: 15093 reply_id: 55952[/import]