Here is multiFire version 1.3. LOL
[lua]local _W = display.contentWidth
local _H = display.contentHeight
local markerNumber = 1
local target = display.newCircle(0,0,25)
target.x = _W/2; target.y = 77;
target:setFillColor(255,0,0)
local target2 = display.newCircle(0,0,25)
target2.x = _W/2-100; target2.y = 77;
target2:setFillColor(255,0,0)
local target3 = display.newCircle(0,0,25)
target3.x = _W/2+100; target3.y = 77;
target3:setFillColor(255,0,0)
local marker1 = display.newCircle(0,0,10)
marker1.x = _W-10; marker1.y = _H-10; marker1:setFillColor(255,0,255)
local marker2 = display.newCircle(0,0,10)
marker2.x = _W-10; marker2.y = _H-10; marker2:setFillColor(0,255,0)
local marker3 = display.newCircle(0,0,10)
marker3.x = _W-10; marker3.y = _H-10; marker3:setFillColor(0,0,255)
local bullet1 = display.newRect(0,0,10,20)
bullet1.x = _W/2; bullet1.y = _H-50
bullet1:setFillColor(255,255,0)
local bullet2 = display.newRect(0,0,10,20)
bullet2.x = _W/2; bullet2.y = _H-50
bullet2:setFillColor(255,255,0)
local bullet3= display.newRect(0,0,10,20)
bullet3.x = _W/2; bullet3.y = _H-50
bullet3:setFillColor(255,255,0)
local fireButton = display.newCircle(0,0,15)
fireButton.x = 40; fireButton.y = _H-40
fireButton:setFillColor(0,255,0)
local function aim (event)
local t = event.target
if event.phase == “ended” then
if markerNumber == 1 then
marker1.x = event.x
marker1.y = event.y
elseif markerNumber == 2 then
marker2.x = event.x
marker2.y = event.y
elseif markerNumber == 3 then
marker3.x = event.x
marker3.y = event.y
end
markerNumber = markerNumber+1
end
end
Runtime:addEventListener(“touch”, aim)
local function fire (e)
if e.phase == “ended” then
transition.to(bullet1, {time = 400, x = marker1.x, y = marker1.y, xScale = .5, yScale = .5})
transition.to(bullet2, {time = 400, x = marker2.x, y = marker2.y, xScale = .5, yScale = .5})
transition.to(bullet3, {time = 400, x = marker3.x, y = marker3.y, xScale = .5, yScale = .5})
end
end
fireButton:addEventListener(“touch”, fire )[/lua]
I’m sure there is a more efficient way of doing this, but I thought I would go ahead and get this out here.
Good luck,
J.K. [import]uid: 66117 topic_id: 17396 reply_id: 65989[/import]