-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d294f0
commit 5116500
Showing
9 changed files
with
210 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
pacman-ui-3d/src/main/java/de/amr/games/pacman/ui3d/apps/ArcadeMsPacManApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package de.amr.games.pacman.ui3d.apps; | ||
|
||
import de.amr.games.pacman.arcade.pacman.PacManGame; | ||
import de.amr.games.pacman.controller.GameController; | ||
import de.amr.games.pacman.model.GameVariant; | ||
import de.amr.games.pacman.ui3d.PacManGamesUI_3D; | ||
import de.amr.games.pacman.ui3d.variants.MsPacManGameConfiguration_3D; | ||
import javafx.application.Application; | ||
import javafx.geometry.Dimension2D; | ||
import javafx.geometry.Rectangle2D; | ||
import javafx.stage.Screen; | ||
import javafx.stage.Stage; | ||
import org.tinylog.Logger; | ||
|
||
import java.io.File; | ||
|
||
public class ArcadeMsPacManApp extends Application { | ||
|
||
private PacManGamesUI_3D ui; | ||
|
||
@Override | ||
public void init() throws Exception { | ||
File userDir = new File(System.getProperty("user.home"), ".pacmanfx"); | ||
if (userDir.mkdir()) { | ||
Logger.info("User dir '{}' created", userDir); | ||
} | ||
GameController.it().addGameImplementation(GameVariant.MS_PACMAN, new PacManGame(userDir)); | ||
GameController.it().selectGame(GameVariant.MS_PACMAN); | ||
} | ||
|
||
@Override | ||
public void start(Stage stage) throws Exception { | ||
ui = new PacManGamesUI_3D(); | ||
ui.loadAssets(); | ||
var config = new MsPacManGameConfiguration_3D(); | ||
ui.setGameConfiguration(GameVariant.MS_PACMAN, config); | ||
ui.assets().addAll(config.assets()); | ||
ui.createAndStart(stage, initialSize()); | ||
} | ||
|
||
private static Dimension2D initialSize() { | ||
Rectangle2D screenSize = Screen.getPrimary().getBounds(); | ||
double aspect = 1.2; | ||
double height = 0.8 * screenSize.getHeight(); | ||
return new Dimension2D(aspect * height, height); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
pacman-ui-3d/src/main/java/de/amr/games/pacman/ui3d/apps/ArcadePacManApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package de.amr.games.pacman.ui3d.apps; | ||
|
||
import de.amr.games.pacman.arcade.pacman.PacManGame; | ||
import de.amr.games.pacman.controller.GameController; | ||
import de.amr.games.pacman.model.GameVariant; | ||
import de.amr.games.pacman.ui3d.PacManGamesUI_3D; | ||
import de.amr.games.pacman.ui3d.variants.PacManGameConfiguration_3D; | ||
import javafx.application.Application; | ||
import javafx.geometry.Dimension2D; | ||
import javafx.geometry.Rectangle2D; | ||
import javafx.stage.Screen; | ||
import javafx.stage.Stage; | ||
import org.tinylog.Logger; | ||
|
||
import java.io.File; | ||
|
||
public class ArcadePacManApp extends Application { | ||
|
||
private PacManGamesUI_3D ui; | ||
|
||
@Override | ||
public void init() throws Exception { | ||
File userDir = new File(System.getProperty("user.home"), ".pacmanfx"); | ||
if (userDir.mkdir()) { | ||
Logger.info("User dir '{}' created", userDir); | ||
} | ||
GameController.it().addGameImplementation(GameVariant.PACMAN, new PacManGame(userDir)); | ||
GameController.it().selectGame(GameVariant.PACMAN); | ||
} | ||
|
||
@Override | ||
public void start(Stage stage) throws Exception { | ||
ui = new PacManGamesUI_3D(); | ||
ui.loadAssets(); | ||
var config = new PacManGameConfiguration_3D(); | ||
ui.setGameConfiguration(GameVariant.PACMAN, config); | ||
ui.assets().addAll(config.assets()); | ||
ui.createAndStart(stage, initialSize()); | ||
} | ||
|
||
private static Dimension2D initialSize() { | ||
Rectangle2D screenSize = Screen.getPrimary().getBounds(); | ||
double aspect = 1.2; | ||
double height = 0.8 * screenSize.getHeight(); | ||
return new Dimension2D(aspect * height, height); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
pacman-ui-3d/src/main/java/de/amr/games/pacman/ui3d/apps/ArcadePacManXXLApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package de.amr.games.pacman.ui3d.apps; | ||
|
||
import de.amr.games.pacman.arcade.pacman_xxl.PacManGameXXL; | ||
import de.amr.games.pacman.arcade.pacman_xxl.PacManGameXXLConfiguration; | ||
import de.amr.games.pacman.controller.GameController; | ||
import de.amr.games.pacman.model.GameVariant; | ||
import de.amr.games.pacman.ui2d.PacManGamesUI; | ||
import de.amr.games.pacman.ui3d.PacManGamesUI_3D; | ||
import de.amr.games.pacman.ui3d.variants.PacManGameXXLConfiguration_3D; | ||
import javafx.application.Application; | ||
import javafx.geometry.Dimension2D; | ||
import javafx.geometry.Rectangle2D; | ||
import javafx.stage.Screen; | ||
import javafx.stage.Stage; | ||
import org.tinylog.Logger; | ||
|
||
import java.io.File; | ||
|
||
public class ArcadePacManXXLApp extends Application { | ||
|
||
private PacManGamesUI_3D ui; | ||
|
||
@Override | ||
public void init() throws Exception { | ||
File userDir = new File(System.getProperty("user.home"), ".pacmanfx"); | ||
if (userDir.mkdir()) { | ||
Logger.info("User dir '{}' created", userDir); | ||
} | ||
GameController.it().addGameImplementation(GameVariant.PACMAN_XXL, new PacManGameXXL(userDir)); | ||
GameController.it().selectGame(GameVariant.PACMAN_XXL); | ||
} | ||
|
||
@Override | ||
public void start(Stage stage) throws Exception { | ||
ui = new PacManGamesUI_3D(); | ||
ui.loadAssets(); | ||
var config = new PacManGameXXLConfiguration_3D(); | ||
ui.setGameConfiguration(GameVariant.PACMAN_XXL, config); | ||
ui.assets().addAll(config.assets()); | ||
ui.createAndStart(stage, initialSize()); | ||
} | ||
|
||
private static Dimension2D initialSize() { | ||
Rectangle2D screenSize = Screen.getPrimary().getBounds(); | ||
double aspect = screenSize.getWidth() / screenSize.getHeight(); | ||
double height = 0.8 * screenSize.getHeight(); | ||
return new Dimension2D(aspect * height, height); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
pacman-ui-3d/src/main/java/de/amr/games/pacman/ui3d/apps/TengenMsPacManApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package de.amr.games.pacman.ui3d.apps; | ||
|
||
import de.amr.games.pacman.controller.GameController; | ||
import de.amr.games.pacman.model.GameVariant; | ||
import de.amr.games.pacman.model.ms_pacman_tengen.MsPacManGameTengen; | ||
import de.amr.games.pacman.tengen.ms_pacman.MsPacManGameTengenConfiguration; | ||
import de.amr.games.pacman.ui2d.PacManGamesUI; | ||
import de.amr.games.pacman.ui3d.PacManGamesUI_3D; | ||
import de.amr.games.pacman.ui3d.variants.MsPacManGameTengenConfiguration_3D; | ||
import javafx.application.Application; | ||
import javafx.geometry.Dimension2D; | ||
import javafx.geometry.Rectangle2D; | ||
import javafx.stage.Screen; | ||
import javafx.stage.Stage; | ||
import org.tinylog.Logger; | ||
|
||
import java.io.File; | ||
|
||
import static de.amr.games.pacman.tengen.ms_pacman.MsPacManGameTengenConfiguration.NES_SIZE; | ||
|
||
public class TengenMsPacManApp extends Application { | ||
|
||
private PacManGamesUI_3D ui; | ||
|
||
@Override | ||
public void init() throws Exception { | ||
File userDir = new File(System.getProperty("user.home"), ".pacmanfx"); | ||
if (userDir.mkdir()) { | ||
Logger.info("User dir '{}' created", userDir); | ||
} | ||
GameController.it().addGameImplementation(GameVariant.MS_PACMAN_TENGEN, new MsPacManGameTengen(userDir)); | ||
GameController.it().selectGame(GameVariant.MS_PACMAN_TENGEN); | ||
} | ||
|
||
@Override | ||
public void start(Stage stage) throws Exception { | ||
ui = new PacManGamesUI_3D(); | ||
ui.loadAssets(); | ||
var config = new MsPacManGameTengenConfiguration_3D(); | ||
ui.setGameConfiguration(GameVariant.MS_PACMAN_TENGEN, config); | ||
ui.assets().addAll(config.assets()); | ||
ui.createAndStart(stage, initialSize()); | ||
} | ||
|
||
private static Dimension2D initialSize() { | ||
Rectangle2D screenSize = Screen.getPrimary().getBounds(); | ||
double aspect = (double) NES_SIZE.x() / NES_SIZE.y(); | ||
double height = 0.8 * screenSize.getHeight(); | ||
return new Dimension2D(aspect * height, height); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters