在Traveler游戏中实现一个计时器 [英] Implementing a timer in Traveller game

查看:137
本文介绍了在Traveler游戏中实现一个计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是我开始此处的延续。
我使用 asteroid 的例子作为一个模型工作。



我想在这里讨论的问题是计时器的问题之一。小行星例子使用 event0 函数创建一个,它依赖于 Graphics.UI.WX 库。我不想在这个项目中使用WX。有人能告诉我什么 event0 在做一般的事情,以便我可以弄清楚我需要做些什么才能做出类似的功能?

Reactive.Banana。框架模块。



来自reactive-banana-wx的 event0 函数只是一个薄包装在 fromAddHandler 功能。反应式香蕉示例代码演示了它的用途。

This problem is a continuation of what I started here. I'm using the asteroid example as a model to work from.

The problem I want to talk about here is the one of a timer. The asteroids example uses the event0 function to make one, which relies on the Graphics.UI.WX library. I don't want to use WX for this project. Could someone tell me what event0 is doing generally, so that I can figure out what I need to do to make a similar function?

解决方案

To bind reactive-banana to an external event-based framework, be it WX or any other, have a look at the Reactive.Banana.Frameworks module.

The event0 function from reactive-banana-wx is just a thin wrapper over the fromAddHandler function from said module. The example code for reactive-banana demonstrates its use.

这篇关于在Traveler游戏中实现一个计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆