-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBus.java
More file actions
30 lines (26 loc) · 796 Bytes
/
Bus.java
File metadata and controls
30 lines (26 loc) · 796 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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* The Bus subclass
*/
public class Bus extends Vehicle
{
public Bus(VehicleSpawner origin){
super (origin); // call the superclass' constructor first
//Set up values for Bus
maxSpeed = 1.5 + ((Math.random() * 10)/5);
speed = maxSpeed;
// because the Bus graphic is tall, offset it a up (this may result in some collision check issues)
}
/**
* Act - do whatever the Bus wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
super.act();
}
public boolean checkHitPedestrian () {
// currently empty
return false;
}
}