Movement?

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]

Not sure how to edit but that function at the top
Is supposed to be
charDown()
y = y + 1 [import]uid: 140157 topic_id: 27688 reply_id: 112279[/import]

There is an edit button near the very bottom of the page under the “Save” and “Preview” buttons.

You aren’t showing enough code here; where is loadChar() function?

If you are interested there’s actually a tutorial on this that may help also; http://corona.techority.com/2011/02/14/controlling-a-character-with-a-d-pad/

Peach :slight_smile: [import]uid: 52491 topic_id: 27688 reply_id: 112505[/import]