FXGL (JavaFX Game Library) is a comprehensive game development framework built on top of JavaFX. It provides powerful features for creating 2D and simple 3D games.
- GitHub: https://github.com/AlmasB/FXGL
- Documentation: https://github.com/AlmasB/FXGL/wiki
- Samples: https://github.com/AlmasB/FXGLGames
FXGL has been added to the project dependencies (version 17.3) but is not yet actively used in the game code. This is intentional - it's available for future enhancements.
FXGL provides many features that can enhance The End The Beginning:
- Sprite management and animation
- Particle effects for combat and magic
- Smooth transitions and animations
- Advanced rendering capabilities
- Entity-component system
- Physics engine (if needed for future gameplay)
- Audio management (music and sound effects)
- Asset management
- Scene management
- Input handling
- Advanced UI components
- Dialogue systems
- Inventory screens
- Achievement displays
- Menu systems
- Add FXGL dependency to pom.xml
- Review FXGL documentation and samples
- Identify specific features to use
- Plan integration strategy
- Create FXGL-based prototype alongside current game
- Test compatibility with existing JavaFX code
- Implement simple animations or effects
- Evaluate performance impact
- Add particle effects for combat
- Implement sprite-based animations
- Enhance UI with FXGL components
- Add sound effects using FXGL audio system
- Consider full FXGL game architecture
- Migrate game logic to FXGL's entity system
- Use FXGL's scene management
- Leverage FXGL's game loop
import com.almasb.fxgl.app.GameApplication;
import com.almasb.fxgl.app.GameSettings;
import com.almasb.fxgl.dsl.FXGL;
public class MyFXGLGame extends GameApplication {
@Override
protected void initSettings(GameSettings settings) {
settings.setWidth(900);
settings.setHeight(700);
settings.setTitle("The End The Beginning");
settings.setVersion("3.0");
}
@Override
protected void initGame() {
// Initialize game entities and world
}
@Override
protected void initUI() {
// Initialize UI components
}
}import com.almasb.fxgl.particle.ParticleEmitter;
import com.almasb.fxgl.particle.ParticleSystem;
// Create particle effect for combat
ParticleEmitter emitter = ParticleEmitters.newExplosionEmitter(50);
emitter.setBlendMode(BlendMode.ADD);
emitter.setSourceImage(texture("particle.png"));import static com.almasb.fxgl.dsl.FXGL.*;
// Play sound effect
play("sword_swing.wav");
// Play background music
getAudioPlayer().loopBGM("dungeon_theme.mp3");- Start by using FXGL for new features only
- Keep existing JavaFX code working
- Migrate features one at a time
- Use FXGL's asset system for resources
- Organize assets in
src/main/resources/assets/ - Structure:
assets/textures/,assets/sounds/,assets/music/
- Test performance impact on different systems
- FXGL adds overhead but provides optimization
- Use profiling to identify bottlenecks
- Document which features use FXGL
- Keep both FXGL and non-FXGL versions during transition
- Update BUILD.md with FXGL-specific requirements
The game currently uses:
- JavaFX for UI (FXML-based)
- CSS for styling
- Custom game logic in controllers
- Plain text save files
FXGL can enhance without replacing this architecture.
- FXGL Wiki - Getting Started
- FXGL Samples Repository
- YouTube: Search "FXGL tutorial" for video guides
- Space Shooter games
- Platformers
- RPGs
- Puzzle games
- FXGL is optional for contributing to this project
- Current game works fine without FXGL features
- FXGL integration is for future enhancements
- Feel free to experiment with FXGL in separate branches
If you're working on FXGL integration and have questions:
- Check the FXGL Wiki
- Look at FXGL sample projects
- Open a GitHub issue in this repository
- Tag the issue with "enhancement" and "FXGL"
Note: This is a living document. Update it as FXGL integration progresses!