diff --git a/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/GameManager.java b/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/GameManager.java new file mode 100644 index 00000000..62c017ab --- /dev/null +++ b/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/GameManager.java @@ -0,0 +1,28 @@ +package io.github.lucasstarsz.fastj.example.hellofastj; + +import io.github.lucasstarsz.fastj.example.hellofastj.scenes.MainScene; +import io.github.lucasstarsz.fastj.example.helloworld.scenes.GameScene; +import io.github.lucasstarsz.fastj.graphics.Display; +import io.github.lucasstarsz.fastj.systems.control.SceneManager; + +import java.awt.*; + +public class GameManager extends SceneManager { + @Override + public void init(Display display) { + // Enables anti-aliasing for all objects in the game + display.modifyRenderSettings(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + + // Create a new instance of our scene + MainScene scene = new MainScene("Hello, FastJ!"); + + // Add the scene to the SceneManager + this.addScene(scene); + + // Set the scene as the current scene + this.setCurrentScene(scene); + + // Tell the logic manager to load our scene + this.loadCurrentScene(); + } +} diff --git a/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/Main.java b/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/Main.java new file mode 100644 index 00000000..d59a09d4 --- /dev/null +++ b/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/Main.java @@ -0,0 +1,11 @@ +package io.github.lucasstarsz.fastj.example.hellofastj; + +import io.github.lucasstarsz.fastj.engine.FastJEngine; + +public class Main { + public static void main(String[] args) { + // Initialize the FastJ Engine with a GameManager instance + FastJEngine.init("Hello, FastJ!", new GameManager()); + FastJEngine.run(); // Run the game engine + } +} diff --git a/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/scenes/MainScene.java b/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/scenes/MainScene.java new file mode 100644 index 00000000..0b6f280c --- /dev/null +++ b/src/example/java/io/github/lucasstarsz/fastj/example/hellofastj/scenes/MainScene.java @@ -0,0 +1,24 @@ +package io.github.lucasstarsz.fastj.example.hellofastj.scenes; + +import io.github.lucasstarsz.fastj.graphics.Display; +import io.github.lucasstarsz.fastj.systems.control.Scene; + +/* The main scene of our game. */ +public class MainScene extends Scene { + public MainScene(String name) { super(name);} + + @Override + public void load(Display display) { + + } + + @Override + public void unload(Display display) { + + } + + @Override + public void update(Display display) { + + } +}