added a test for the particle engine
This commit is contained in:
parent
e3f5017007
commit
d3a6c31dd1
4 changed files with 419 additions and 18 deletions
57
src/ei/engine/test/ParticlesTest.java
Normal file
57
src/ei/engine/test/ParticlesTest.java
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
package ei.engine.test;
|
||||
|
||||
|
||||
import ei.engine.LWJGLGameWindow;
|
||||
import ei.engine.effects.Particles;
|
||||
import ei.engine.math.Vector2f;
|
||||
import ei.engine.scene.Node;
|
||||
|
||||
public class ParticlesTest extends LWJGLGameWindow{
|
||||
private ParticlesTestFrame ptf;
|
||||
private Particles p;
|
||||
private Node rootNode;
|
||||
|
||||
public static void main(String[] args){
|
||||
new ParticlesTest();
|
||||
}
|
||||
|
||||
public ParticlesTest() {
|
||||
super("ParticlesTest");
|
||||
}
|
||||
|
||||
protected void init(){
|
||||
rootNode = new Node("InGameNode");
|
||||
|
||||
ptf = new ParticlesTestFrame();
|
||||
ptf.getJFrame().setVisible(true);
|
||||
|
||||
p = new Particles("particle");
|
||||
p.setLocation(new Vector2f(200,200));
|
||||
rootNode.add(p);
|
||||
}
|
||||
|
||||
protected void update() {
|
||||
super.update();
|
||||
p.life = ptf.life.getValue();
|
||||
p.MaxSpeedX = ptf.maxSpeedX.getValue();
|
||||
p.MaxSpeedY = ptf.maxSpeedY.getValue();
|
||||
p.MaxSpeedZ = ptf.maxSpeedZ.getValue();
|
||||
p.pullForceX = ptf.pullForceX.getValue();
|
||||
p.pullForceY = ptf.pullForceY.getValue();
|
||||
p.pullForceZ = ptf.pullForceZ.getValue();
|
||||
p.rainbow = ptf.rainbow.isSelected();
|
||||
p.regenerate = ptf.regenerate.isSelected();
|
||||
p.size = ptf.size.getValue();
|
||||
p.slowdown = ptf.slowdown.getValue();
|
||||
p.xspeed = ptf.xspeed.getValue();
|
||||
p.yspeed = ptf.yspeed.getValue();
|
||||
rootNode.update();
|
||||
}
|
||||
|
||||
/**
|
||||
* this method shid be overriden
|
||||
*/
|
||||
protected void render(){
|
||||
rootNode.render();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue