0

I'm trying to get the hang of Corona SDK, I don't know much about the Lua language as I'm coming from a C# and XNA background. The question I have is I want to do some acceleration on an object when a touch arrow is touched on the screen.

In XNA your variable changes and the code for it would be done in the Update section, but I'm not entirely sure how to do it in Corona. At the moment the arrow just moves at a constant speed with this code.

 function button:touch()
   motiony = -speed 
 end
 button:addEventListener("touch", button)

Any help or pointers in the right direction would be appreciated.

greatwolf
  • 20,287
  • 13
  • 71
  • 105

1 Answers1

0

Make a variable to store acceleration. When you touch the button, change the acceleration value, and apply it to the object's speed.

mlepage
  • 2,372
  • 2
  • 19
  • 15