来自 XNA,Corona 的“更新”是什么?机制(游戏时间,游戏时间)?

发布于 2024-12-06 00:30:06 字数 317 浏览 2 评论 0原文

我正在尝试掌握 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你列表最软的妹 2024-12-13 00:30:06

创建一个变量来存储加速度。当您触摸按钮时,更改加速度值,并将其应用于对象的速度。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文