将对象显示为 Corona SDK 中模块的 属性 / Lua? (作曲家)
Display objects as property of modules in Corona SDK / Lua? (composer)
我正在使用 Corona SDK 的 composer
库开发游戏,但我遇到了 设计模式 的问题。假设我有一堆 modules
,我在 main.lua
中可以全局访问它们。在思考如何使 modules
之间的通信变得容易之后,我想到了使 module
生成 display objects
properties
的方法。我首先尝试了 oop 方法,但后来我最终通过复杂的 parameter structures
摔跤,通过了 objects
,这让 debugging
很痛苦。
您可以看到这种方法有什么问题吗?为了稳定性,我需要重新考虑我的方法吗?
感谢您的帮助!
你好,尼尔斯
也许可以尝试使用Custom Events 来对象通信。另请阅读
Using custom events to make game objects communicate 在 Corona 论坛上
Creating and Dispatching Custom Events in Corona SDK 在 YouTube 上
此外,我还建议您分析 Ponywolf on Corona marketplace 中的三款免费开源游戏。我自己做:)
我正在使用 Corona SDK 的 composer
库开发游戏,但我遇到了 设计模式 的问题。假设我有一堆 modules
,我在 main.lua
中可以全局访问它们。在思考如何使 modules
之间的通信变得容易之后,我想到了使 module
生成 display objects
properties
的方法。我首先尝试了 oop 方法,但后来我最终通过复杂的 parameter structures
摔跤,通过了 objects
,这让 debugging
很痛苦。
您可以看到这种方法有什么问题吗?为了稳定性,我需要重新考虑我的方法吗?
感谢您的帮助!
你好,尼尔斯
也许可以尝试使用Custom Events 来对象通信。另请阅读
Using custom events to make game objects communicate 在 Corona 论坛上
Creating and Dispatching Custom Events in Corona SDK 在 YouTube 上
此外,我还建议您分析 Ponywolf on Corona marketplace 中的三款免费开源游戏。我自己做:)