-
Notifications
You must be signed in to change notification settings - Fork 2
/
MysteryShip.java
55 lines (45 loc) · 1 KB
/
MysteryShip.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
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
/**
*
* @author Derick Owens
*
*/
public class MysteryShip extends Enemy {
//Generate a randomly selected mystery value between 50 and 250
protected int mysteryValue;
/**
*
* @param p location of the mystery ship
* @param s size of the mystery ship
* @param points value of the mystery ship
* @param i image of the mystery ship
*/
public MysteryShip(Point p, Rectangle s, int points, Image i){
super(p, s, points, i);
mysteryValue = points;
}
/**
* Move the mystery ship
*/
public void move()
{
location.x += arbitraryVector.getChangeX();
location.y += arbitraryVector.getChangeY();
}
/**
* @return the randomValue
*/
public int getMysteryValue() {
return mysteryValue;
}
/**
* @param randomValue the randomValue to set
*/
public void setMysteryValue(int randomValue) {
this.mysteryValue = randomValue;
}
}import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;