score = 0
playx = 300
playy = 420
function love.keypressed(key)
if key == "w" then
elseif key == "d" then
playx = playx + 10
elseif key == "a" then
playx = playx - 10
end
end
function love.draw()
love.graphics.draw(player,playx,playy)
end
function love.load()
love.graphics.setBackgroundColor(255,0,0)
love.window.setTitle("Space Shooter Pre-Alpha")
ammo = love.graphics.newImage("ammo.png")
player = love.graphics.newImage("goodplayer.png")
end
Could make a variable that toggles whenever the W key is down. The way you're doing it doesn't seem to allow for much else if W is pressed. Might want to have a look at checking for keypresses individually and triggering each key's action individually. Create a variable called wdown = false in love.load() (or whatever you want to call it) and then in update assign it the value of love.keyboard.isDown('w'). In love.draw() simply put in an if(wdown) where you draw whatever it is you want to draw when W is down.