Fixed a sound bugg and added a new load bar.
This commit is contained in:
parent
88fcd15266
commit
7aa445f694
8 changed files with 11 additions and 12 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 235 B |
Binary file not shown.
|
Before Width: | Height: | Size: 257 B |
Binary file not shown.
|
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 330 B |
|
|
@ -22,8 +22,6 @@ public class LWJGLGameWindow {
|
|||
private static Camera cam;
|
||||
// The framerate
|
||||
private int fps;
|
||||
// If fullscreen
|
||||
private boolean fullscreen;
|
||||
// The title
|
||||
private String title;
|
||||
// The fps calculator
|
||||
|
|
@ -64,7 +62,6 @@ public class LWJGLGameWindow {
|
|||
LWJGLGameWindow.width = width;
|
||||
LWJGLGameWindow.height = height;
|
||||
this.fps = fps;
|
||||
this.fullscreen = fullscreen;
|
||||
this.title = title;
|
||||
|
||||
MultiPrintStream.makeInstance(new MultiPrintStream("log.txt"));
|
||||
|
|
@ -90,7 +87,6 @@ public class LWJGLGameWindow {
|
|||
public void createWindow(DisplayMode dm, boolean fullscreen){
|
||||
LWJGLGameWindow.width = dm.getWidth();
|
||||
LWJGLGameWindow.height = dm.getHeight();
|
||||
this.fullscreen = fullscreen;
|
||||
MultiPrintStream.makeInstance(new MultiPrintStream("log.txt"));
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class BitmapProgressBar extends Entity{
|
|||
if(progress != null){
|
||||
progress.setLocation(new Vector3f(
|
||||
(LWJGLGameWindow.getWidth()/2)-progress.getSize().getX(),
|
||||
(LWJGLGameWindow.getHeight()/2)+3,0.0f));
|
||||
(LWJGLGameWindow.getHeight()/2),0.0f));
|
||||
}
|
||||
if(background != null){
|
||||
background.setLocation(getLocation());
|
||||
|
|
@ -200,7 +200,7 @@ public class BitmapProgressBar extends Entity{
|
|||
if(progress != null){
|
||||
progress.setLocation(new Vector3f(
|
||||
getLocation().getX()-progress.getSize().getX()+(progress.getSize().getX()*procent),
|
||||
getLocation().getY()+6,0.0f));
|
||||
getLocation().getY(),0.0f));
|
||||
progress.render();
|
||||
}
|
||||
if(bar != null) bar.render();
|
||||
|
|
|
|||
|
|
@ -279,4 +279,10 @@ public class SoundManager {
|
|||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
for(int i=0; i<sources.size() ;i++){
|
||||
stopSound(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package ei.game.gamestate;
|
|||
|
||||
import ei.engine.scene.Node;
|
||||
import ei.engine.sound.Sound;
|
||||
import ei.engine.sound.SoundManager;
|
||||
import ei.engine.state.GameState;
|
||||
import ei.game.hud.InGameHud;
|
||||
import ei.game.input.InGameKeyboardInput;
|
||||
|
|
@ -29,6 +30,7 @@ public class InGameState extends GameState{
|
|||
public void init() {
|
||||
PlayerHandler.getInstance().clear();
|
||||
WeaponHandler.getInstance().clear();
|
||||
SoundManager.getInstnace().clear();
|
||||
|
||||
rootNode = new Node("InGameNode");
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@ public class LoadingState extends GameState{
|
|||
//The files to load
|
||||
private static final String[] TEXTURES = {
|
||||
"data/font.bmp",
|
||||
"data/loadbar_back.png",
|
||||
"data/loadbar_front.png",
|
||||
"data/loadbar.png",
|
||||
"data/logo.png",
|
||||
"data/particle.bmp",
|
||||
"data/splash.png",
|
||||
"data/buildings/cc/cc_building.png",
|
||||
|
|
@ -104,7 +100,6 @@ public class LoadingState extends GameState{
|
|||
progress.centerToScreen();
|
||||
progress.setBarTexture(new Sprite("ProgressBar","data/loadbar_front.png"));
|
||||
progress.setProgressTexture(new Sprite("Progress","data/loadbar.png"));
|
||||
progress.setBackgroundTexture(new Sprite("progressBackground","data/loadbar_back.png"));
|
||||
|
||||
for(int i=0; i<TEXTURES.length ;i++){
|
||||
addTexture(TEXTURES[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue