我正在努力开发菜单系统,以便我进行非常简单的ong子测试,并给th子带来一些麻烦。 几个实例 我已经看到,在菜单屏幕上推出和缩小选择的守则只是:
if (controller.Thumbsticks.Left.Y > 0.5f) MenuUp();
虽然从理论上讲,这一检验是每个框架(见Update(>
calls,表面上)进行的,检查控制器状态的时间大约为60倍。 由于平均用户将至少排位第二季度,结果是几乎瞬时把控制器的tick周期推向整个菜单。
我可能实施某种复杂的时间制度,其中检查了自上一次菜单项目改变以来的多长时间,以及th子被打上了多长时间,但我在网络上发现没有任何样本使用这种复杂的时间制度。 我失踪了吗?
<><>Edit>: 安德鲁在下文的评论中询问,与我发现的这些理论的联系:
- This one uses
if (controller.isButtonPressed(Buttons.LeftThumbstickUp))
but it is the same idea.
http://create.msdn.com/en-US/education/catalog/sample/game_state_management - I realize this one is XNA 2.0 (I m working with 4.0) but the principle remains
http://www.sgtconker.com/2010/08/nick-gravelyns-alien-aggressors-tutorial/ - Also, Chad Carter s "Microsoft XNA Game Studio 3.0 Unleashed" book, on page 530, shows similar code. His system checks the previous gamepad state, so his system won t scroll instantly through several options, but it also doesn t let you scroll at all - each time you want to move up a menu option, you have to move the thumbstick back to center and push it back up again. I am looking for behavior more like when you press and hold a key on your keyboard: one letter appears, a slight delay, and then starts repeating the letter at a measured pace.