When I create a player like this:
local onPlayerSpawnObject = function(object)
local layer = map:getTileLayer("Player")
player = display.newImage(layer.group, "guy.png")
physics.addBody(player, {density = 1.0, friction = 0.3, bounce = 0.2})
player.x = object.x
player.y = object.y
end
map:addObjectListener("PlayerSpawn", onPlayerSpawnObject)
I cannot use the line player:move(xAmount, yAmount)inside a move function for a joystick.
Am I missing something?
Thanks!
[import]uid: 62961 topic_id: 11135 reply_id: 311135[/import]