I’m trying to create a spaceship game. I wanted to use a sprite in my project. Here is a part of the code. I hope you understand.
function update (time, delta)
{
if (cursors.left.isDown)
{
ship.x -= speed * delta;
}
else if (cursors.right.isDown)
{
ship.x += speed * delta;
}
else if (cursors.up.isDown)
{
ship.y -= speed * delta;
}
else if(cursors.down.isDown){
ship.y += speed * delta;
}
}