Hi Anthony! Something rather odd has happened... I have achieved Multiple bullets but they don't fire correctly... What appears to be happening is there are multiple bullets but when fire key is pressed a bullet appears at playership1's position but doesn't move. while this is happening another bullet spawns on the left hand side of the screen and fires upwards as usual.
I have run over the firing code
stage:addEventListener(Event.KEY_DOWN,function(e)
if e.keyCode==KeyCode.LEFT then
left=true
playerDir=-1
elseif e.keyCode==KeyCode.RIGHT then
right=true
playerDir=1
elseif e.keyCode==KeyCode.Z then
print("fire")
bx,by=playership1:getPosition()
bullets[counter] = bpool:createObject()
stage:addChild(bullets[counter])
bullets[counter]:setPosition(bx,by)
bDir=-1
counter = counter+1
end
and all seems to be correct (it is calling "bullet" to the playership in bullets[counter]:setPosition(bx,by)
and is moving the bullet in bDir=-1).
I believe
June 2015