Курсовая работа: Разработка приложения на Java
setBackground(Color.black);
back = getImage(getCodeBase(), "screan.gif");
for (z=0 ; z < 400 ; z++){dot[z] = getImage(getCodeBase(), "dot.gif"); }
}
public void update(Graphics g)
{
Dimension d = this.size();
if(offI == null)
{
offI = createImage(d.width, d.height);
offG = offI.getGraphics();
}
offG.clearRect(0, 0, d.width, d.height);
paint(offG);
g.drawImage(offI, 0, 0, null);
}
public void paint(Graphics g)
{
g.drawImage(back, 0, 0, this);
g.setColor(Color.white);
if(started)
{
g.setFont(new Font("Verdana", 1, 12));
t = "Score "+score+"";
g.drawString(t, 75, 220);
}
if(game==1)
{
g.setFont(new Font("Verdana", 1, 13));