ya hi, i am trying to make my first homebrew game in Lua which is basically a space ship that has to shoot the targets flying by. Ive been able to get the ship to move left and right but i cant figure out how to get bullets working. Can any1 post a link to a tut or somting that explains how to make a bullet shoot from the ship.
*update* i have been able to get a bulelt to appear in frnt of the ship but i cant figure out how to get it to move up.
heres my code so far
thnx in advanceCode:System.usbDiskModeActivate() shipx = 235 shipy = 230 background = Image.load ("background.png") enemy = Image.load ("enemy.png") ship = Image.load ("ship.png") bullet = Image.load ("bullet.png") bullety = shipy - 40 bulletmove = bullety + 2 while true do screen:blit(0, 0, background, false) pad = Controls.read() screen:blit(shipx, shipy, ship, true) screen.flip() if pad:left() then shipx = shipx - 2 end if pad:right() then shipx = shipx + 2 end if shipx <= 2 then shipx = 2 end if shipx >= 445 then shipx = 445 end if pad:cross() then screen:blit(shipx + 15.5, bulletmove, bullet, true) screen.flip() end if pad:start() then break end end