简体   繁体   English

J2ME游戏流畅刷新

[英]J2ME game smooth refresh

I have developed a game in J2ME. 我在J2ME中开发了一个游戏。 Logic is going perfectly. 逻辑进展顺利。 But the problem is that my sprites are not going properly. 但是问题是我的精灵运行不正常。 They appear continuously flashing. 它们似乎不断闪烁。 I tried to reduce their size but doesn't help much. 我试图减小它们的尺寸,但并没有太大帮助。 I also tried to remove sounds and minimize multiplications and divisions with only a little effect. 我还尝试了消除声音并最小化乘法和除法的效果。

My refresh rate is once per 30 milliseconds. 我的刷新率是每30毫秒一次。 My images lie between 300 bytes to 1 kb. 我的图像在300字节到1 kb之间。 Any tips? 有小费吗?

如果您使用canvas或使用已经具有双重缓冲实现功能的gamecanvas,则可以更好地手动实现双重缓冲

On a mobile phone, once every 30 milliseconds is possibly too much. 在手机上,每30毫秒一次可能太多了。 I created a JME game using only 15 FPS and animations looked fine. 我仅使用15 FPS创建了一个JME游戏,动画效果还不错。 Obviously it depends on the game but I'd look into reducing the frame rate if I was you. 显然,这取决于游戏,但如果您是我,我会考虑降低帧频。 As mentioned by @Ashok double buffering is used to solve these kinds of problems and it probably will solve your problem. 如@Ashok所述,双缓冲用于解决此类问题,它很可能会解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM