-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameOver.java
executable file
·56 lines (46 loc) · 1.12 KB
/
GameOver.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
public class GameOver extends JPanel implements Menu
{
private Image title;
private Image crosshair;
private int min_select=0;
private int max_select=2;
private Image dbImage;
private Graphics dbg;
private MediaTracker mt;
public GameOver()
{
Toolkit toolkit=Toolkit.getDefaultToolkit();
title=toolkit.getImage(getClass().getResource("backgrounds/gameover.png"));
mt=new MediaTracker(this);
setBackground(Color.black);
mt.addImage(title,0);
try
{
mt.waitForAll();
} catch(Exception e){};
setBackground(Color.black);
}
public void render(Graphics g,int x,int y,int key,Screen s)
{
// initialize buffer
if (dbImage == null)
{
dbImage = createImage(x,y);
dbg = dbImage.getGraphics ();
}
// clear screen in background
dbg.setColor(Color.black);
dbg.fillRect(0, 0, 640, 480);
//Create image here...
dbg.drawImage(title,0,25,s);
g.drawImage (dbImage,0,0,s);
}
public void setSelection(int s)
{
}
}