-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathScales.java
More file actions
42 lines (39 loc) · 1.06 KB
/
Scales.java
File metadata and controls
42 lines (39 loc) · 1.06 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
import java.awt.*;
/**
* Write a description of class Scales here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Scales extends Dragon
{
// instance variables
private Color scaleColor;
/**
* Constructor for objects of class ScaledDragon
*/
public Scales(int x,int y, int size, int R,int G,int B, String attackType, String dragonText)
{
// initialise instance variables
super(x,y,size,R,G,B,attackType, dragonText);
}
/**
* drawScales
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
private void drawScales(Graphics g)
{
g.setColor(scaleColor);
for(int y = super.y(); y < super.y() + super.x+size * 25 - 15; y +=14){
for(int x = super.getBodyX(); x < super.getBodyX() + super.getBodyWidth() - 15; x += 14){
g.drawLine(x, y, x+10, y+10);
}
}
}
public void drawDragon(Graphics g){
super.drawDragon(g);
drawScales(g);
}
}