How to draw a line

I want to make a game that involves drawing a line so a ball will go down the line. How do i write code to make a line? Thank you.

I assume you want the user to draw the line, correct?

I knew it! This should probably get you what you want:

http://developer.anscamobile.com/code/martian-control

re: drawing a line
store the touch points in a table in the "moved" phase. meanwhile, during every enterframe remove & redraw the line between the points.

this is the technique suggested by ansca. you might think you would just :append to the line every time you process a touch "moved" but this is not the method that works.

http://developer.anscamobile.com/forum/2010/12/15/displaylineappend-doesnt-work-realtime-unless-linewidth-set-eg-linewidth00000001

however as for physics on the line i'm not sure.

views:2040 update:2011/9/21 9:18:04
corona forums © 2003-2011