-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCruiser.java
More file actions
47 lines (42 loc) · 1.08 KB
/
Copy pathCruiser.java
File metadata and controls
47 lines (42 loc) · 1.08 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
43
44
45
46
47
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* This is the Crusier class.
* There is nothing special about thsi class as it is for increase the diversity.
* It will crash any SupplyBoat class that it is in contact with.
*
* @author George Lu
* @version final 2023/4/1
*/
public class Cruiser extends Ship
{
/**
* This is the constructor of the Cruiser
*
* @param origin This is the spawner it will spawn on
* @param lane This is teh lane it will move on
*/
public Cruiser(VehicleSpawner origin, int lane)
{
super(origin, lane);
maxSpeed = 2;
speed = maxSpeed;
save = maxSpeed;
hp = 5;
}
//This is the act method of the Crusier class
public void act()
{
drive();
hitted();
damage();
}
//This is the not need method from the ship class
public boolean checkHitPedestrian ()
{
return false;
}
//This is the not need method from the ship class
public void stopPlay()
{
}
}