-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathM.java
More file actions
59 lines (53 loc) · 1.29 KB
/
M.java
File metadata and controls
59 lines (53 loc) · 1.29 KB
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
56
57
58
59
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JButton;
public class M
{
public Sprite sprite=Sprite.pillar;
public Keyboard key;
private JButton button;
int change=10;
M(Keyboard key)
{
this.key=key;
}
public void update()
{
if(key.enter)
{
Game.menu=1;
Game.start=false;
}
}
public void render(Screen screen)
{
screen.clear();
}
public void drawscreen(Graphics g)
{
if(Game.menu==0)
{
try
{
//BufferedImage image=ImageIO.read(Spritesheet.class.getResource("/bc.png"));
BufferedImage image=ImageIO.read(Spritesheet.class.getResource("/start.png"));
g.drawImage(image,0,0,Game.getWindowWidth(), Game.getWindowHeight(), Color.gray, null); //Color.gray??????????????????
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("image error");
}
g.setColor(Color.white);
Font h=new Font("ArcadeClassic", Font.BOLD, 60);
g.setFont(h);
if(change<=0)change=10;
else change-=1;
if(change==2||change==3||change==4||change==5)
g.drawString("PRESS ENTER", 480, 650);
}
}
}