-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameOver.java
56 lines (50 loc) · 1.75 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 greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.Color;
import java.awt.Font;
/**
* Write a description of class GameOver here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class GameOver extends ScrollActor
{
public GameOver() {
GreenfootImage newImage = new GreenfootImage (800, 600);
Font fontObj = new Font("Comic Sans MS", Font.BOLD, 82);
newImage.setFont(fontObj);
//newImage.setColor(Color.yellow);
Color customColor = new Color(238, 201, 0);
newImage.setColor(customColor);
newImage.scale(newImage.getWidth(), newImage.getHeight());
newImage.drawString("GAME OVER", 200, 320);
setImage(newImage);
/*
//set gameover image
GreenfootImage newImage = new GreenfootImage (this.width, this.height);
setImage(newImage);
GreenfootImage newImage = getImage();
newImage.clear();
//GreenfootImage image = new GreenfootImage("bid.png");
// newImage = new GreenfootImage("small.png");
Font fontObj = new Font("Comic Sans MS", Font.BOLD, 56);
newImage.setFont(fontObj);
//
newImage.setColor(Color.white);
// newImage.fill();
// newImage.scale(newImage.getWidth()+20, newImage.getHeight());
// newImage.setColor(Color.black);
//newImage.drawImage(image,10,25);
newImage.drawString( "Game Over!",60, 50);
setImage(newImage);
*/
}
/**
* Act - do whatever the GameOver wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
}
}