move sprite to player
This commit is contained in:
parent
8574888e18
commit
0a80fecf12
2
main.lua
2
main.lua
@ -55,9 +55,7 @@ end
|
||||
|
||||
function beginContact(a, b, coll)
|
||||
player.grounded = true
|
||||
player.sprite = sprites.player_stand
|
||||
end
|
||||
function endContact(a, b, coll)
|
||||
player.grounded = false
|
||||
player.sprite = sprites.player_jump
|
||||
end
|
||||
|
@ -19,4 +19,11 @@ function playerUpdate(dt)
|
||||
player.body:setX(player.body:getX() + player.speed * dt)
|
||||
player.direction = DIRECTION_RIGHT
|
||||
end
|
||||
|
||||
if player.grounded == true then
|
||||
player.sprite = sprites.player_stand
|
||||
else
|
||||
player.sprite = sprites.player_jump
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user