我试图通过让两个位图分开滑动来实现向我的游戏过渡,就像一个从中间开放的车库门,一半向下滑动半个向上。无论如何,当我这样做时,它看起来非常不稳定,帧率似乎不稳定/不可靠。这是我如何做的。图形筷子
public class TFView extends View{
...
public void startlevel(Canvas c){
long l =(SystemClock.currentThreadTimeMillis()-starttime)/3;//*(height/500);
if(l<1000){
c.drawBitmap(metalbottom,0,height/2+l,p);
c.drawBitmap(metaltop,0,0-l,p);}
}
public void endlevel(Canvas c){
long l =(SystemClock.currentThreadTimeMillis()-failtime)/3;
if(l>=height/2){
c.drawBitmap(metaltop, 0, 0, p);
c.drawBitmap(metalbottom, 0,height/2 , p);
}
else{
c.drawBitmap(metalbottom,0,-height/2+l,p);
c.drawBitmap(metaltop,0,height-l,p);}
}}
我设定了我想分别打开/关闭门的时间。那么,你认为我应该改变什么才能使它更平滑的过渡?将它转换为surfaceview有帮助吗?
是U试图在模拟器中还是真正的电话吗? – the100rabh
我使用了我的手机和模拟器 – Derek