does anyone know why the game would only shoot one bullet when my shooting system is the same as evil mana's system
Printable View
does anyone know why the game would only shoot one bullet when my shooting system is the same as evil mana's system
there maybe a code stoping it in the halo game he could only shoot 5 bulletts at a time and they didnt come out right add something likke if bullet<1 in to one of the bullet functions perferably the one that controlls the bullet:cool:
No code = no idea.
Show the code for firing.
hes yousing evil manas bullet code ill look in to it
i think it yousing all of the bullets to fast:cool:
here is all my shooting code takin from my script
KEEP IN MIND THIS IS ONLY THE SHOOTING STUFF
function bulletSetup()
--Increase the current bullet by one, or reset it to 1
if currentBullet < 5 then
currentBullet = currentBullet + 1
else
currentBullet = 1
end
BulletInfo[currentBullet].direction = direction
BulletInfo[currentBullet].firing = true
end
function bulletFire()
for i = 1,5 do
if BulletInfo[i].firing == true then
if BulletInfo[i].direction == "right" then BulletInfo[i].x = BulletInfo[i].x + 10 end
if BulletInfo[i].direction == "left" then BulletInfo[i].x = BulletInfo[i].x - 10 end
screen:blit(BulletInfo[i].x,BulletInfo[i].y,BulletInfo[i].pic)
end
if BulletInfo[i].x < 0 or BulletInfo[i].x > 480 or BulletInfo[i].y < 0 or BulletInfo[i].y > 272 then
BulletInfo[i].firing = false
end
end
end
--Create Array for Bullets
BulletInfo = {}
for a = 1,5 do
BulletInfo[a] = { pic = bullet , firing = false, direction = "right", x = player.x + 32,
y = player.y + 25 }
end
if direction == "left" then
bullet = bullet1
end
if direction == "right" then
bullet = bullet
end
currentBullet = 0
bulletFire()
if pad:square() and oldpad:square() ~= pad:square() then
bulletSetup()
end
if direction == "right" then
bullet = bullet
end
andQuote:
if direction == "left" then
bullet = bullet1
end
if direction == "right" then
bullet = bullet
end
Are very wrong. Why do you want something to equal itself?Quote:
if direction == "right" then
bullet = bullet
end
should be 1.Quote:
currentBullet = 0
Why is the firing code in the middle of no where in the program?Quote:
BulletInfo[currentBullet].direction = direction
BulletInfo[currentBullet].firing = true
end
it still only shoots once
I say it be a 'flow of logic' problem. You might not be calling functions in the right order or in the right place. I ideally need the whole code to fix that.
do u want it to shoot 5 i dont remeber samus shooting more than 1 well except for littel ones you should put a thing in to stop quick shotting such as old pad and then allow any number of bullets are you going to make the charging bullet i could help wit that :cool: gettin so board of working on mine hope fully it will be ready before school becuz right now i got football 5 to 9 during school i wont have any time to do any thing till about 8:30 not including home work what was i talkin about agian:confused:
UPDATE
morph ball now works (w/ some help by crait)
and i have a game over screen now
http://i59.photobucket.com/albums/g2...a-xversion.png