SENSOR_DELAY_GAME:多少钱? [英] SENSOR_DELAY_GAME: how much is it?

查看:127
本文介绍了SENSOR_DELAY_GAME:多少钱?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发游戏,我需要同步两种玩家对象控制机制:一种是屏幕上的触摸控制器,第二种是G传感器.屏幕控制器必须以秒为单位初始化一个值,所以我需要知道SENSOR_DELAY_GAME意味着多少秒.预先感谢.

I'm working on a game and I need to synchronize two player object controlling mechanisms: one is an on-screen touch controller and second is the G-Sensor. On-screen controller must be initialized with a value in seconds, so I need to know how much seconds does SENSOR_DELAY_GAME mean. Thanks in advance.

推荐答案

我认为您的问题没有确定的答案,这意味着这取决于设备.除此之外,请记住,即使为传感器定义了一定的延迟,传感器管理器"也可能会比您指定的结果更快或更慢地返回结果.对于您的情况,我认为最好的方法是在传感器运行了一定时间后,用两次连续轮询之间的平均时间(以秒为单位),用SENSOR_DELAY_GAME标志初始化,并将该时间传递给您屏幕控制器初始化.

I don't think there is a definite answer into your question, in a meaning that this is device depended. Except from that, keep in mind that even if you define a certain delay for your sensor, the Sensor Manager may return results faster or slower than what you specified. For your case, i think the best approach is to take the average time (in seconds) between two consecutive polls after a certain amount of time that your sensor is running, initialized with the SENSOR_DELAY_GAME flag, and pass that time to your on-screen controller initialization.

这篇关于SENSOR_DELAY_GAME:多少钱?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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