Added class EntityArtillery
This commit is contained in:
parent
f04b2b4c5a
commit
d0cfbc503d
31
EntityArtillery.java
Normal file
31
EntityArtillery.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import java.awt.*;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class EntityArtillery {
|
||||||
|
private int speed;
|
||||||
|
private float weight;
|
||||||
|
private Color bodyColor;
|
||||||
|
|
||||||
|
public void Init(int speed, float weight, Color bodyColor) {
|
||||||
|
Random rnd = new Random();
|
||||||
|
this.speed = speed <= 0 ? rnd.nextInt(50, 150) : speed;
|
||||||
|
this.weight = weight <= 0 ? rnd.nextInt(40, 70) : weight;
|
||||||
|
this.bodyColor = bodyColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSpeed() {
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getWeight() {
|
||||||
|
return weight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Color getBodyColor() {
|
||||||
|
return bodyColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getStep() {
|
||||||
|
return speed * 100 / weight;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user