i have a gun script but it doesn't work
i made a gun script bur for some reason, it only draws my player and doesn't fire, sprite3 is the bullet and sprite is the player, i cannot see any errors in my script though.
this is my script:
init = function() Wsize = 35 Lsize = 35 dir = 0 firing = 0 end
update = function() walk() screen.fillRect(0,0,700,700,"rgb(0,255,255)") screen.drawSprite("sprite4"0,0,200,200) if not move.x == goal.x or move.y == goal.y then screen.drawSprite("sprite3",move.x,move.y,10,10) end screen.drawSprite("sprite",player.x,player.y,Wsize,Lsize) end
draw = function() end
walk = function() if keyboard.A then player.x -= 1 end if keyboard.D then player.x += 1 end if keyboard.S then player.y -= 1 end if keyboard.W then player.y += 1 end end pew = function() if mouse.Release then if firing == 0 then firing = 1 goal.x = mouse.x goal.y = mouse.y if not move.x == goal.x or move.y == goal.y then
if goal.x >= 0 then
move.x += 1
elsif goal.x < 0 then
move.x -= 1
end
if goal.y >= 0 then
move.y += 1
elsif goal.y < 0 then
move.y -= 1
end
end
if check == 0 then
check = 1
pos.x = player.x
pos.y = player.y
screen.drawSprite("sprite3",pos.x,pos.y,10,10)
end
end end end