//Отрисовка карты
public void Draw(Canvas canvas) {
for (GameObject obj: objects) {
float ox = obj.x * game.atom() + x;
float oxw = (obj.x + obj.w) * game.atom() + x;
float oy = obj.y * game.atom() + y;
float oyh = (obj.y + obj.h) * game.atom() + y;
if (oxw < 0 || oyh < 0 || ox > canvas.getWidth() || oy > canvas.getHeight()) {
return;
}
p.setAlpha(obj.a);
canvas.drawBitmap(obj.img, x + obj.x * game.atom(), y + obj.y * game.atom(), p);
}
}
//Отрисовка карты
public void Draw(Canvas canvas) {
for (GameObject obj: objects) {
p.setAlpha(obj.a);
canvas.drawBitmap(obj.img, x + obj.x * game.atom(), y + obj.y * game.atom(), p);
}
}