Didn’t find any tuts or posts on how to do one hence my post.
I am trying to figure out how to draw a line from ship1 to ship2 and have it onscreen for only say 0.5 seconds while the sound effect plays. I was going to draw say 2 lines over one another with the 2nd line being wider and lower alpha to try and get a cheap glow effect with additive blending.
I can draw a line from point to point but how can i have it be on screen for the firing duration of say 0.5 seconds.
Any pointers, tips, tuts or shared code?
Thanks in advance for your time and assistance,
Gib
@Gib Here’s a simple example. Tap the screen to shoot.
function setup()
shoot=0
end
function draw()
background(40, 40, 50)
if shoot>0 then
shoot=shoot-1
lineCapMode(SQUARE)
stroke(0,255,0)
strokeWidth(3)
line(50,50,400,400)
stroke(0,255,0,80)
strokeWidth(10)
line(50,50,400,400)
end
end
function touched(t)
if t.state==BEGAN then
shoot=30
end
end