-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDobranowskiMovingThing.java
104 lines (85 loc) · 1.64 KB
/
DobranowskiMovingThing.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//� A+ Computer Science
//www.apluscompsci.com
//Name - Patrick Dobranowski
import java.awt.Color;
import java.awt.Graphics;
//all moving objects such as player, aliens, and bullets inherit from these broader class
public class DobranowskiMovingThing
{
private int xPos;
private int yPos;
private int width;
private int height;
public DobranowskiMovingThing()
{
xPos = 10;
yPos = 10;
width = 10;
height = 10;
}
public DobranowskiMovingThing(int x, int y)
{
xPos = x;
yPos = y;
width = 10;
height = 10;
}
public DobranowskiMovingThing(int x, int y, int w, int h)
{
xPos = x;
yPos = y;
width = w;
height = h;
}
//setter methods that change position of given object
public void setPos( int x, int y)
{
xPos = x;
yPos = y;
}
public void setX(int x)
{
xPos = x;
}
public void setY(int y)
{
yPos = y;
}
//getter methods that return a given variable in the DobranowskiMovingThing class
public int getX()
{
return xPos; //finish this method
}
public int getY()
{
return yPos; //finish this method
}
//more setter methods that change the look and layout of the given moving object
public void setWidth(int w)
{
width = w;
}
public void setHeight(int h)
{
height = h;
}
//more getter methods that return parts of the look and layout of the given moving object
public int getWidth()
{
return width; //finish this method
}
public int getHeight()
{
return height; //finish this method
}
public void move(String direction)
{
}
public void draw(Graphics window)
{
}
public String toString()
{
return getX() + " " + getY() + " " + getWidth() + " " + getHeight();
}
}