Implementing a timer in Traveller game

廉价感情. 提交于 2019-12-22 18:04:29

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/12625963/implementing-a-timer-in-traveller-game

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!