瀏覽代碼

New engine version

- Updated the game and engine versions.
- Moved the launcher to the engine.
Tankernn 8 年之前
父節點
當前提交
593667e118
共有 3 個文件被更改,包括 9 次插入37 次删除
  1. 3 3
      pom.xml
  2. 6 1
      src/main/java/eu/tankernn/game/Game.java
  3. 0 33
      src/main/java/eu/tankernn/game/Launcher.java

+ 3 - 3
pom.xml

@@ -3,7 +3,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>eu.tankernn.game</groupId>
 	<artifactId>tankernn-3d-game</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
+	<version>0.0.2</version>
 	<name>Tankernn 3D Game</name>
 
 	<repositories>
@@ -18,7 +18,7 @@
 		<dependency>
 			<groupId>eu.tankernn.gameEngine</groupId>
 			<artifactId>tankernn-game-engine</artifactId>
-			<version>1.1</version>
+			<version>1.2</version>
 		</dependency>
 	</dependencies>
 
@@ -37,7 +37,7 @@
 							<archive>
 								<manifest>
 									<addClasspath>true</addClasspath>
-									<mainClass>eu.tankernn.game.Launcher</mainClass>
+									<mainClass>eu.tankernn.game.Game</mainClass>
 								</manifest>
 								<manifestEntries>
 			                        <Specification-Title>${project.name}</Specification-Title>

+ 6 - 1
src/main/java/eu/tankernn/game/Game.java

@@ -12,6 +12,7 @@ import java.util.List;
 import org.lwjgl.util.vector.Vector3f;
 import org.lwjgl.util.vector.Vector4f;
 
+import eu.tankernn.gameEngine.GameLauncher;
 import eu.tankernn.gameEngine.TankernnGame;
 import eu.tankernn.gameEngine.entities.Entity;
 import eu.tankernn.gameEngine.entities.Light;
@@ -42,7 +43,7 @@ public class Game extends TankernnGame {
 	Player player;
 
 	public Game() {
-		super(new Skybox(Texture.newCubeMap(InternalFile.fromFilenames("skybox", TEXTURE_FILES, "png"), 200), Texture.newCubeMap(InternalFile.fromFilenames("skybox", NIGHT_TEXTURE_FILES, "png"), 200), 400), DUDV_MAP, NORMAL_MAP);
+		super(Settings.GAME_NAME, new Skybox(Texture.newCubeMap(InternalFile.fromFilenames("skybox", TEXTURE_FILES, "png"), 200), Texture.newCubeMap(InternalFile.fromFilenames("skybox", NIGHT_TEXTURE_FILES, "png"), 200), 400), DUDV_MAP, NORMAL_MAP);
 		entities = new ArrayList<Entity>();
 
 		lights = new ArrayList<Light>();
@@ -111,4 +112,8 @@ public class Game extends TankernnGame {
 		waterMaster.renderWater(camera, lights);
 		DisplayManager.updateDisplay();
 	}
+	
+	public static void main(String[] args) {
+		GameLauncher.launch(new Game());
+	}
 }

+ 0 - 33
src/main/java/eu/tankernn/game/Launcher.java

@@ -1,33 +0,0 @@
-package eu.tankernn.game;
-
-import org.lwjgl.opengl.Display;
-
-import eu.tankernn.gameEngine.TankernnGame;
-import eu.tankernn.gameEngine.renderEngine.DisplayManager;
-import eu.tankernn.gameEngine.util.NativesExporter;
-
-import static eu.tankernn.game.Settings.*;
-
-public class Launcher {
-	
-	public static TankernnGame instance;
-	
-	public static void main(String[] args) {
-		init();
-		
-		while (!Display.isCloseRequested()) {
-			instance.update();
-			instance.render();
-		}
-		
-		instance.cleanUp();
-		DisplayManager.closeDisplay();
-	}
-	
-	private static void init() {
-		NativesExporter.exportNatives();
-		DisplayManager.createDisplay(GAME_NAME);
-		instance = new Game();
-	}
-	
-}