Skip to content

Commit 8ef89f5

Browse files
authored
Jesus Christ, [who is] the faithful witness
And from Jesus Christ, [who is] the faithful witness, [and] the first begotten of the dead, and the prince of the kings of the earth. Unto him that loved us, and washed us from our sins in his own blood (Revelation 1:5)
1 parent 279dd71 commit 8ef89f5

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
// And from Jesus Christ, [who is] the faithful witness, [and] the first begotten of the dead, and the prince of the kings of the earth. Unto him that loved us, and washed us from our sins in his own blood (Revelation 1:5)
3+
4+
package com.javarush.task.task25.task2515;
5+
6+
public class Rocket extends BaseObject {
7+
public Rocket(double x, double y) {
8+
super(x, y, 1);
9+
}
10+
11+
public void move() {y--;}
12+
13+
public void draw(Canvas canvas) {
14+
canvas.setPoint(x, y, 'R');
15+
}
16+
}
17+
18+
/*
19+
Space (11)
20+
21+
Теперь напишем класс Rocket.
22+
23+
Практически совпадает с классом Bomb.
24+
25+
Только:
26+
27+
а) Ракета летит вверх (т.е. y уменьшается на 1);
28+
29+
б) Рисуем не букву "B", а букву "R".
30+
31+
32+
33+
34+
35+
Требования:
36+
37+
1. В классе Rocket конструктор должен принимать координаты, а радиус выставлять всегда равным 1.
38+
39+
2. В классе Rocket напиши метод move(), который уменьшает координату y на единицу.
40+
41+
3. В классе Rocket напиши метод draw(Canvas canvas), который для canvas будет ставить символ 'R' в координатах x, y.
42+
*/

0 commit comments

Comments
 (0)