Starsector API
Loading...
Searching...
No Matches
GBGoInDirection.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.ghosts;
2
3import org.lwjgl.util.vector.Vector2f;
4
5import com.fs.starfarer.api.util.Misc;
6
7
8public class GBGoInDirection extends BaseGhostBehavior {
9
10 protected float direction;
11 protected int maxBurn;
12
13 public GBGoInDirection(float duration, float direction, int maxBurn) {
14 super(duration);
15 this.direction = direction;
16 this.maxBurn = maxBurn;
17 }
18
19
20
21 @Override
22 public void advance(float amount, SensorGhost ghost) {
23 super.advance(amount, ghost);
24
25 Vector2f loc = Misc.getUnitVectorAtDegreeAngle(direction);
26 loc.scale(10000f);
27 Vector2f.add(loc, ghost.getEntity().getLocation(), loc);
28 ghost.moveTo(loc, maxBurn);
29
30 }
31
32
33
34}
35
36
37
38
39
40
41
42
43
44
45
46
47
GBGoInDirection(float duration, float direction, int maxBurn)
void moveTo(Vector2f dest, float maxBurn)