I’ve searched all over and I really can’t find a fix for this.
I’m trying to make movement by pressing the arrow keys.
Right now I only have the down arrow key set up.
You just press and hold but you only move 1 time?
[code]
– RIGHT
function charRight()
print( “RIGHT” )
sprite = “guyLR.png”
x = x + 1
loadChar()
end
function moveTouch( event )
– Down Boundaries
if event.y > 278 and event.y < 310 and event.x > 32 and event.x < 64 then
if event.phase == “began” then – Timer response (start)
dTimer = timer.performWithDelay( 100, charDown )
elseif event.phase == “ended” then – Timer response (end)
timer.cancel( dTimer )
end
end
end
– Keys Load
local upAr = display.newImage( “up.png” )
local downAr = display.newImage( “down.png” )
local leftAr = display.newImage( “left.png” )
local rightAr = display.newImage( “right.png” )
downAr.x = 48
downAr.y = 294
leftAr.x = 26
leftAr.y = 272
rightAr.x = 70
rightAr.y = 272
upAr.x = 48
upAr.y = 250
Runtime:addEventListener(“touch”, moveTouch) [import]uid: 140157 topic_id: 27688 reply_id: 327688[/import]
[import]uid: 52491 topic_id: 27688 reply_id: 112505[/import]