-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBullet.java
More file actions
33 lines (30 loc) · 781 Bytes
/
Bullet.java
File metadata and controls
33 lines (30 loc) · 781 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
31
32
33
public class Bullet extends Projectile {
public Bullet(
double x,
double y,
double dx,
double dy,
double angle,
int shipID,
double velocity,
int ttl,
int damage,
double mass,
boolean friendlyFire) {
super(Double.POSITIVE_INFINITY);
this.x = x;
this.y = y;
this.dx = dx + Math.cos(angle) * velocity;
this.dy = dy + Math.sin(angle) * velocity;
this.angle = angle;
this.shipID = shipID;
this.velocity = velocity;
this.ttl = ttl;
this.damage = damage;
this.mass = mass;
this.friendlyFire = friendlyFire;
baseAccelRate = 0;
isAccel = 1;
diam = 5;
}
}