-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPulsar.java
More file actions
33 lines (26 loc) · 1.09 KB
/
Pulsar.java
File metadata and controls
33 lines (26 loc) · 1.09 KB
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
/**********************************************************************************
*
* GOAL: Complete step(...) method to add pulse functionality
*
**********************************************************************************/
public class Pulsar extends Body {
private boolean imageRev; // is the image reversed?
private int imageCount; // number of steps taken since last image reversal
// images to swap between every 10 steps
String image = "pulsar.gif";
String reverseImage = "pulsarR.gif";
// create and init a new object with input parameters scanned from a .txt file
public Pulsar(double[] arr, double R) {
super(arr, R);
newImage("pulsar.gif");
imageCount = 0;
imageRev = false;
}
// use Body step update and then attempt to update image
@Override
public void step(double dt) {
// call the Body class step method
super.step(dt);
// TODO: update this Pulsar object's image from image to reverseImage every 10 steps
}
}