-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDragon.java
More file actions
52 lines (47 loc) · 973 Bytes
/
Dragon.java
File metadata and controls
52 lines (47 loc) · 973 Bytes
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
import java.awt.*;
/**
* Write a description of class Dragon here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Dragon
{
// instance variables - replace the example below with your own
private int x;
private int y;
private int size;
/**
* Default Constructor for objects of class Dragon
*/
public Dragon()
{
// initialise instance variables
x = 50;
y = 50;
size = 1;
}
/**
* Overloaded Constructors go here
*/
/**
* Accessor Methods
*/
/**
* drawDragon(Graphics g)
* Starting of drawing, complete your Dragon....
*/
public void drawDragon(Graphics g)
{
g.fillRect(x, y , size * 50, size * 50);
}
/**
* Mutator Methods
*/
/**
* toString
*/
public String toString(){
return "x coor: " + x + " y coord: " + y + " size: " + size;
}
}