gvsu/cs654/final-proj/Shot.java
josh 7795f9bc1c imported from remote update
git-svn-id: svn://anubis/gvsu@97 45c1a28c-8058-47b2-ae61-ca45b979098e
2008-04-13 17:27:05 +00:00

38 lines
989 B
Java

public class Shot extends GameItem
{
public static final double DEFAULT_RADIUS = 0.03;
public static final double SHOT_DURATION = 3.0;
public static final double SHOT_DAMAGE = 0.27;
public long createTime;
public Integer id;
public Shot(Integer id, long createTime, double x, double y)
{
this.id = id;
this.createTime = createTime;
this.radius = DEFAULT_RADIUS;
this.x = x;
this.y = y;
this.dx = 0;
this.dy = 0;
}
public boolean equals(Shot other)
{
return this.createTime == other.createTime &&
this.radius == other.radius &&
this.x == other.x &&
this.y == other.y &&
this.dx == other.dx &&
this.dy == other.dy;
}
public String toString()
{
return String.format("%d:%.3f:%.3f:%.3f:%.3f:%.3f",
id, radius, x, y, dx, dy);
}
}