ea92234b360dbb34e8c65a380deca88b803d4b18
1 package code
.kalter
.longflight
.game
;
3 import javax
.microedition
.lcdui
.Graphics
;
6 * Цветовой эффект при попадании пули в игрока
10 public class ColorEffect
{
12 private final int screenW
;
13 private final int screenH
;
15 private final int color
;
16 //==========================
17 private final int number
; // количество кадров для рисования цветного экрана
18 private int count
; // счётчик
19 //==========================
22 public ColorEffect(int color
, int number
, int screenW
, int screenH
) {
25 this.screenW
= screenW
;
26 this.screenH
= screenH
;
29 public void activate() {
34 public void paint(Graphics graphics
) {
36 graphics
.setColor(color
);
37 graphics
.fillRect(0, 0, screenW
, screenH
);
38 is
= ++count
< number
;