Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the 'hellofastj' package #19

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
@@ -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) {

}
}