Hi. Ok I have this game were I have this enemy that go across the screen in portrait. While the enemy goes across it shoots. What I got so far is the enemy shooting, but only once. Here is the code
[code] local function enemies3 ()
local enem3 = display.newRect(0,0, 100, 100)
enem3.y = math.random(30, 290)
enem3.x = 600
enem3.isFixedRotation = true
enem3.isSensor = true
physics.addBody (enem3, {bounce=0.6})
transition.to (enem3, {time = 5000, x=-50})
enem3.hit = “enem3”
enem3.hits = 0
localGroup:insert(enem3)
local badtwin = display.newRect(0,0, 10, 10)
badtwin.x = enem3.x - 40
badtwin.y = enem3.y
badtwin.hit = “badtwin”
physics.addBody (badtwin, {bounce=0.6})
localGroup:insert(badtwin)
local function shootmorebad ()
transition.to (badtwin, {time = 1000, x= - 50})
end
badshoot1 = timer.performWithDelay(1, shootmorebad, -1)
end
timer3 = timer.performWithDelay(math.random (1000, 5000), enemies3, -1)[/code]
What I try to do is have the enemy shoot more than once, but I’am struggling with that. This code is also plug and play but it goes in portrait. [import]uid: 17058 topic_id: 22656 reply_id: 322656[/import]