求告知:游戏中怎么实现整个画面向下运动的效果?还有黑色块怎么随机出现呢?
------解决思路----------------------
}
public class CanvasView extends View implements View.OnTouchListener{
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
_Paint = new Paint();
canvas.drawBitmap(mBitmap, imgx, imgy, _Paint);
//mBitmap是你要向下运动图,增大imgy就会向下运动 ,
Random random1 = new Random(100);
if( (random1.nextInt()%10)==2)
canvas.drawBitmap(黑色块bmp , nx, ny, _Paint);
//random1.nextInt()%10 随机=2显示黑色块,,随机数用到nx,ny可以在不同的坐标显示
}
}