View Full Version : [AS3] Making a Tether
Ciubhran
04-18-2009, 06:59 PM
I want to create a tethered line between two objects. One stationary, and one that is moving around.
Example:
A tower defense game where the tower shoots a laser that burns the moving enemy for X damage every second. The laser beam is always gonna be visible, and always connected to the moving unit.
scarce
04-19-2009, 02:16 AM
I want to create a tethered line between two objects. One stationary, and one that is moving around.
Example:
A tower defense game where the tower shoots a laser that burns the moving enemy for X damage every second. The laser beam is always gonna be visible, and always connected to the moving unit.
now by tethered do you mean with an elastic bouncy for of quality? or like a stiff bar swing on a pole?
kkbbcute
04-19-2009, 03:46 AM
Just use a onEnterFrame function with a lineTo to draw a line to the enemy.x/y. Ensure that the line is inside an MC, and add a dynamic glow filter to give that "laser look" that you want. ;)
Ciubhran
04-19-2009, 12:16 PM
Just use a onEnterFrame function with a lineTo to draw a line to the enemy.x/y. Ensure that the line is inside an MC, and add a dynamic glow filter to give that "laser look" that you want. ;)
That's what I am doing now, but I would have to remove every older line that has been drawn before the current frame then.
Also, how do you add a dynamic glow in AS3?
kkbbcute
04-19-2009, 01:24 PM
That's what I am doing now, but I would have to remove every older line that has been drawn before the current frame then.
That's why you put the line in its own individual MC, so you don't clear everything else ;)
Also, check this out (filters):
http://blip.tv/file/1228797
That's what I am doing now, but I would have to remove every older line that has been drawn before the current frame then.
You mean like .clear() ?
bluemagica
04-22-2009, 07:11 AM
download this and learn from it!
http://www.freeactionscript.com/2008/12/weapon-lightning-gun-effect/
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.