Hydraman
04-14-2010, 03:41 PM
Hi all,
I am currently working on a game that will allow the user to click on a dude and then draw a free form line. The dude will then follow the path of the line the user drew. If the user clicks on the dude again, the path will be erased and the user can draw a new path. I am using graphics.moveTo() and graphics.lineTo() to draw the paths.
My problem is when I try to put more than one dude on the screen and I wish to redraw a path. When a dude is clicked on, I call graphics.clear() which erases all the paths on the screen. I still have an array of points I can use to reconstruct the lines but that seems like a hassle if I could just not delete the other lines in the first place.
What is the best way to accomplish my goal? Should I be using the graphics API to draw my lines or is there a better way? Should I be putting each line in its own transparent Symbol and then adding them that way? Would that be a problem with overlapping symbols?
I would appreciate any guidance and I can provide more details upon request. I am new to flash/as3 but I am an experienced .NET developer.
I am currently working on a game that will allow the user to click on a dude and then draw a free form line. The dude will then follow the path of the line the user drew. If the user clicks on the dude again, the path will be erased and the user can draw a new path. I am using graphics.moveTo() and graphics.lineTo() to draw the paths.
My problem is when I try to put more than one dude on the screen and I wish to redraw a path. When a dude is clicked on, I call graphics.clear() which erases all the paths on the screen. I still have an array of points I can use to reconstruct the lines but that seems like a hassle if I could just not delete the other lines in the first place.
What is the best way to accomplish my goal? Should I be using the graphics API to draw my lines or is there a better way? Should I be putting each line in its own transparent Symbol and then adding them that way? Would that be a problem with overlapping symbols?
I would appreciate any guidance and I can provide more details upon request. I am new to flash/as3 but I am an experienced .NET developer.