来自 XNA,Corona 的“更新”是什么?机制(游戏时间,游戏时间)?
我正在尝试掌握 Corona SDK,但我对 Lua 语言了解不多,因为我有 C# 和 XNA 背景。我的问题是,当屏幕上触摸触摸箭头时,我想对物体进行一些加速。
在 XNA 中,您的变量更改及其代码将在“更新”部分中完成,但我不完全确定如何在 Corona 中执行此操作。目前,箭头仅使用此代码以恒定速度移动。
function button:touch()
motiony = -speed
end
button:addEventListener("touch", button)
任何正确方向的帮助或指示将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个变量来存储加速度。当您触摸按钮时,更改加速度值,并将其应用于对象的速度。
Make a variable to store acceleration. When you touch the button, change the acceleration value, and apply it to the object's speed.