This is a big commit. Added mouse cursors and a load bar. Started whit the game. and many many other things
This commit is contained in:
parent
448fca2fdf
commit
4e7722fedb
34 changed files with 597 additions and 95 deletions
19
src/ei/engine/test/GameStateTest.java
Normal file
19
src/ei/engine/test/GameStateTest.java
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package ei.engine.test;
|
||||
|
||||
import ei.engine.LWJGLGameWindow;
|
||||
import ei.engine.state.GameStateManager;
|
||||
|
||||
public class GameStateTest extends LWJGLGameWindow{
|
||||
public static void main(String[] args){
|
||||
new GameStateTest();
|
||||
}
|
||||
|
||||
public GameStateTest() {
|
||||
super("GameStateTest");
|
||||
}
|
||||
|
||||
protected void init(){
|
||||
GameStateManager.getInstance().addState(new GameStateTestState("GameStateTestState"));
|
||||
GameStateManager.getInstance().setActive("GameStateTestState");
|
||||
}
|
||||
}
|
||||
49
src/ei/engine/test/GameStateTestState.java
Normal file
49
src/ei/engine/test/GameStateTestState.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
package ei.engine.test;
|
||||
|
||||
import ei.engine.LWJGLGameWindow;
|
||||
import ei.engine.effects.Particles;
|
||||
import ei.engine.math.Vector2f;
|
||||
import ei.engine.scene.Node;
|
||||
import ei.engine.scene.Sprite;
|
||||
import ei.engine.sound.Sound;
|
||||
import ei.engine.state.GameState;
|
||||
|
||||
|
||||
public class GameStateTestState extends GameState{
|
||||
private Node rootNode;
|
||||
private Sprite sprite1;
|
||||
private Sound sound1;
|
||||
private Particles p;
|
||||
|
||||
public GameStateTestState(String name){
|
||||
super(name);
|
||||
rootNode = new Node("InGameNode");
|
||||
|
||||
sprite1 = new Sprite("tank","data/units/tank.png");
|
||||
//sprite1.setScale(new Vector2f(0.5f,0.5f));
|
||||
//sprite1.setLocation(new Vector2f(300,300));
|
||||
rootNode.add(sprite1);
|
||||
|
||||
p = new Particles("particle");
|
||||
p.setLocation(sprite1.getLocation());
|
||||
rootNode.add(p);
|
||||
|
||||
sound1 = new Sound("sound","data/sounds/center.wav");
|
||||
sound1.loop();
|
||||
sound1.setLocation(sprite1.getLocation());
|
||||
rootNode.add(sound1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
rootNode.render();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
LWJGLGameWindow.getCamera().getLocation().add(new Vector2f(-1.5f,-1.5f));
|
||||
sprite1.getRotation().add(0, 0, 0.5f);
|
||||
rootNode.update();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ import org.lwjgl.util.WaveData;
|
|||
* @version $Revision$
|
||||
* $Id$
|
||||
*/
|
||||
public class PositionTest extends BasicTest {
|
||||
public class SoundPositionTest extends BasicTest {
|
||||
|
||||
/** *Small* glut implementation :) */
|
||||
private GLUT glut;
|
||||
|
|
@ -148,10 +148,6 @@ public class PositionTest extends BasicTest {
|
|||
// =====================================================
|
||||
LWJGLUtil.log("Setting up window");
|
||||
|
||||
// calc center
|
||||
int centerX = (Display.getDisplayMode().getWidth() - WINDOW_WIDTH) / 2;
|
||||
int centerY = (Display.getDisplayMode().getHeight() - WINDOW_HEIGHT) / 2;
|
||||
|
||||
// setup window
|
||||
setDisplayMode();
|
||||
Display.create();
|
||||
|
|
@ -180,7 +176,7 @@ public class PositionTest extends BasicTest {
|
|||
|
||||
AL10.alListener(AL10.AL_POSITION, listenerPosition);
|
||||
AL10.alListener(AL10.AL_VELOCITY, listenerVelocity);
|
||||
//AL10.alListener(AL10.AL_ORIENTATION, listenerOrientation);
|
||||
AL10.alListener(AL10.AL_ORIENTATION, listenerOrientation);
|
||||
|
||||
// creating buffers
|
||||
LWJGLUtil.log("Creating buffers");
|
||||
|
|
@ -481,7 +477,7 @@ public class PositionTest extends BasicTest {
|
|||
* String array containing arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
PositionTest positionTest = new PositionTest();
|
||||
SoundPositionTest positionTest = new SoundPositionTest();
|
||||
positionTest.execute(args);
|
||||
System.exit(0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue