Java / JavaFX / Kotlin Game Library (Engine)

Overview

promo

About

JavaFX Game Development Framework

Maven Central Build Status codecov sponsor

Why FXGL?

  • No installation or setup required
  • "Out of the box": Java 8-15, Win/Mac/Linux/Android 8+/iOS 11.0+/Web
  • Simple and clean API, higher level than other engines
  • Superset of JavaFX: no need to learn new UI API
  • Real-world game development techniques: Entity-Component, interpolated animations, particles, and many more
  • Games are easily packaged into a single executable .jar or native images

Good for:

  • Any 2D game (side-scroller / platformer / arcade / RPG)
  • Any business application with complex UI controls / animations
  • Experimental 3D
  • Hobby / academic / commercial projects
  • Teaching / learning / improving game development skills
  • Fast prototyping of app ideas

Minimal Example

public class BasicGameApp extends GameApplication {

    @Override
    protected void initSettings(GameSettings settings) {
        settings.setWidth(800);
        settings.setHeight(600);
        settings.setTitle("Basic Game App");
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Getting Started

For a quick dive into code, see standalone basic examples. Otherwise, see:

Maven

  • Maven template project if you use Java and/or Kotlin (Java 11+)

Make sure to set <release>11</release> for maven-compiler-plugin.

<dependency>
    <groupId>com.github.almasb</groupId>
    <artifactId>fxgl</artifactId>
    <version>11.14</version>
</dependency>

Note: use 0.5.4 for Java 8-10.

Gradle

  • Gradle template project if you use Java and/or Kotlin (Java 11+)

Please refer to the template if there are any errors.

repositories {
    jcenter()
}

dependencies {
    compile 'com.github.almasb:fxgl:11.14'
}

Note: use 0.5.4 for Java 8-10.

Modularity

If you wish to develop a modular application, here's a complete example of your module-info.java:

open module app.name {
    requires com.almasb.fxgl.all;
}

Uber jar

Download the latest uber jar from Releases

Community

  • University of Brighton, UK
  • University of Nottingham, UK
  • kidOYO, USA
  • Walton High School, USA
  • Conant High School, USA
  • Zealand Institute of Business and Technology, Denmark
  • Federal Institute of Education, Science and Technology of Rio Grande do Sul, Brazil
  • FHNW School of Engineering / Computer Science, Switzerland

If your institution wants to use or is using FXGL, add a note in the Chat to be added to the list.

Community tutorials:

Community projects (identified using fxgl topic):

If you'd like your project featured here, just add a note in the Chat.

Contribution & Support

If you want to build FXGL from sources or want to contribute, please see the Contribution Guide (including non-code). FXGL is fully modular, so new contributors do not need to understand the entire codebase, only the module to which the contribution is made. Contributions will be reviewed in accordance with the Code of Conduct.

You can support the FXGL development or show interest by simply starring the repo or becoming a sponsor.

Sponsors

Users:

  • @Marsl10
  • @SergeMerzliakov
  • @mbains
  • @sabit86
  • @hendrikebbers

Companies:

  • @karakun

Contact

  • Ask questions on StackOverflow with tags javafx and fxgl
  • Tweet with #fxgl
  • Chat with the friendly FXGL community
Comments
  • Assets fail to load in a multi-module project

    Assets fail to load in a multi-module project

    Hi, I run into the following problem when running the demo based on https://github.com/AlmasB/FXGL/wiki/Adding-Images-and-Sounds :

    12:03:59.131 [JavaFX Application Thread] FATAL AssetLoader - Loading failed for asset: drop.wav. Cause: Unrecognized file signature! 12:03:59.131 [JavaFX Application Thread] FATAL GameApplication - Uncaught Exception: 12:03:59.132 [JavaFX Application Thread] FATAL GameApplication -

    Exception occurred: java.lang.IllegalArgumentException : Failed to load asset: drop.wav. Cause: Unrecognized file signature! E: com.almasb.fxgl.asset.AssetLoader.loadFailed(AssetLoader.kt:652) E: com.almasb.fxgl.asset.AssetLoader.loadSound(AssetLoader.kt:216) E: com.almasb.fxgl.audio.AudioPlayer.playSound(AudioPlayer.kt:114) E: FXGLBasicGameApp.lambda$0(FXGLBasicGameApp.java:103)

    Both drop.wav and brick.png won't load.

    In my project, I leave the demo class file within a maven package. The AssetLoader has trouble looking for my resources folder (let alone the textures and sounds within).

    I've tried using getResource() to get the relative path

    String path = this.getClass().getResource("../../assets/textures/brick.png").toExternalForm();

    but AssetLoader doesn't understand it.

    Is there a way to load assets from resources in this case ?

    Thanks much for any insight and keep up the good work !

    opened by mokun 28
  • Extract all hardcoded text into localized strings and add translations

    Extract all hardcoded text into localized strings and add translations

    • [ ] Extract hardcoded text
    • [ ] Translate text to other languages (need people who speak French and German), translations to other languages are also welcome
    type:refactor help wanted difficulty:easy 
    opened by AlmasB 27
  • Preserve scene ratio

    Preserve scene ratio

    Hi Almas, basically, I want to make my game resizable, so I set manualResizeEnabled to true. The built-in scale mechanism works well, except for the fact that I want to preserve the original ratio. I opted to create rectangles on both left and right of the scene so that the window could be resized as much as wanted, so that the actual game resolution would be the same. Honestly, I don't know how to do this in FXGL since width/scale properties aren't modified in contentRoot and I don't know where to set listeners.

    opened by iamgio 26
  • iOS: Add AudioService implementation

    iOS: Add AudioService implementation

    On mobile, JavaFXPorts doesn't port the JavaFX Media API, so all the Sound calls will fail.

    The Charm Down video service provides an implementation for iOS and Android that allows playing mp3 or other audio formats.

    We could try to keep the current implementation for Desktop and use the Video service on mobile.

    dependencies {
        compile 'com.gluonhq:charm-down-plugin-video:3.7.0'
        androidRuntime 'com.gluonhq:charm-down-plugin-video-android:3.7.0'
        iosRuntime 'com.gluonhq:charm-down-plugin-video-ios:3.7.0'
    }
    
    type:new feature help wanted mobile 
    opened by jperedadnr 20
  • 3D games with FXyz

    3D games with FXyz

    As a JavaFX developer with interest in both games, and 3D, and also 3D games, I have been following both FXGL and FXyz for a while. It would make my day to see the two projects work together.

    I know there are reasons why FXGL hasn't gone 3D. I know that game development is not a goal for FXyz. Still, I think my hope may have a place on the web, and that would be right here.

    type:new feature 
    opened by travisfw 15
  • AssetLoader doesn't have access to assets folder in a modular project

    AssetLoader doesn't have access to assets folder in a modular project

    When the project is modular, since AssetLoader is in a different module, it doesn't have access to the assets/sound or assets/texture resources folders.

    Fatal exception occurred: java.lang.IllegalArgumentException : Failed to load asset: brick.png. Cause: Asset "/assets/textures/brick.png" was not found!
    E: com.almasb.fxgl.all/com.almasb.fxgl.app.AssetLoader.loadFailed(AssetLoader.kt:628)
    E: com.almasb.fxgl.all/com.almasb.fxgl.app.AssetLoader.loadTexture(AssetLoader.kt:158)
    E: com.almasb.fxgl.all/com.almasb.fxgl.dsl.FXGL$Companion.texture(FXGL.kt:203)
    E: com.almasb.fxgl.all/com.almasb.fxgl.dsl.EntityBuilder.view(EntityBuilder.kt:96)
    E: hellofx/org.openjfx.BasicGameApp.initGame(BasicGameApp.java:78)
    

    which is caused by: GameApplication.FXGLApplication.app?.javaClass?.getResource(name) being null, in `AssetLoader::getURL.

    There are a few options to solve this (using getClassLoader().getResource() should do it, and it is the simplest way. Other options involve something more complex like ModuleLayer.boot().findModule(moduleName)...)

    opened by jperedadnr 15
  • Pause main loop when the stage is minimized

    Pause main loop when the stage is minimized

    Hi,

    I just noticed something strange while playing around with FXGL and the newest space invader game. When the stage is minimized my CPU Usage went up by quiet a bit. I've done some research in the library and found that if the stage is minimized the AnimationTimer (mainLoop) in the GameApplication class executes much faster than it should. Normally it should cap at 60 FPS but it went way faster. Can you confirm this? Or am I crazy? 😆 I am not sure if thats maybe even a bug in the AnimationTimer class itself since I tried writing a small test without FXGL and I got the same result. Maybe that behavior is even expected and I just don't know. But that would mean that if a game is running and gets minimized the whole game would update too fast.

    Therefore my proposal would be in case that is something we want to resolve is that the game gets paused when minimized. I suppose we can add a changelistener to the focusproperty of the stage and stop the mainloop accordingly.

    The way I tested it was by incrementing a counter in the mainLoop and printing it. As soon as I minimized the stage the counter incremented a lot faster.

    type:new feature help wanted 
    opened by SNException 15
  • In 11.13 event handler can not be removed anymore

    In 11.13 event handler can not be removed anymore

    The following code worked as expected in 11.12:

    final EventType<T> eventType = ...
    final EventHandler<? super T> eventHandler = ...
    
    FXGL.getInput().addEventHandler(eventType, eventHandler);
    
    //Now the event handler is registered and the program reacts on user interaction
    
    FXGL.getInput().removeEventHandler(eventType, eventHandler);
    
    //The handler has been removed and the program does not react on the user interaction anymore
    

    With an update to 11.13 the removeEventHandler does not work anymore. The event handler is still registered.

    type:bug 
    opened by hendrikebbers 13
  • After starting the new window has dimensions 0x0

    After starting the new window has dimensions 0x0

    screenshot

    On the screenshot you see the code and the result. The window doesn't take into account the values were put to the settings. So it has as small size as the OS can let.

    But i found the root of the problem (as i think). If to debug the code you may notice the minHeight and minWidth of the stage are 0-s. Look at this code snippet from the FXGL library

    public static final class FXGLApplication extends Application
    {
    	public static GameApplication app;
    	private static ReadOnlyGameSettings settings;
    	
    	/**
    	 * This is the main entry point as run by the JavaFX platform.
    	 */
    	@Override
    	public void start(Stage stage)
    	{
    		var engine = new Engine(app, settings, stage);
    		
    		settings.getEngineServices().forEach(serviceClass ->
    			engine.addService(ReflectionUtils.newInstance(serviceClass))
    		);
    		
    		if (settings.getApplicationMode() != ApplicationMode.RELEASE && settings.isDeveloperMenuEnabled())
    		{
    			engine.addService(new DevService());
    		}
    		
    		FXGL.inject$fxgl(engine);
    		
    		engine.startLoop();
    	}
    }
    

    If to add such, lines everything works fine.

    		stage.setMinHeight(settings.getHeight());
    		stage.setMinWidth(settings.getWidth());
    

    Environment:

    OS: Linux Mint 19.3 (Cinnamon DE, GTK3)
    
    $ java --version
    openjdk 11.0.6 2020-01-14
    OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
    OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)
    
    JavaFX version: 11.0.2
    
    FXGL version: 11.7
    
    opened by vyalyh-oleg 13
  • Ubuntu 18.04 App runs to fast

    Ubuntu 18.04 App runs to fast

    I was playing around with the library and the game examples and the games were running to fast. I then found the solution to the problem on Ubuntu 16.04 in the wiki but it did not work in my system. I am using IntelliJ IDE and I tried adding the option in Run>Edit Configurations>VM options and it didn't work. Finally I tried running any game from the binaries folder in the FXGLGames repo from the terminal with java -jar -Dquantum.mutithreaded=false ... and it also didn't fix the problem.

    I was thinking about just running the whole app slower via a global configuration but i couldn't find anything like it in the API.

    opened by gchaperon 13
  • HitBox does not scale with view

    HitBox does not scale with view

    for_almasb

    So i am having some major issues with either the scaling of hitboxes or the collision system. As can be seen there are no objects touching in the video but collisions are registering and that little spec (an animation that hasn't been scaled yet) appears way above the frog and to the left when it is meant to go the the exact center position of the frog. When I hit CTRL+0 and turn hitbox view on it shows what I am expecting for the hitboxes but the position of the animation changes when it is still just replacing the view of the frog. I have no clue why these entities are causing collisions when their hitboxes aren't touching

    type:bug in progress 
    opened by bturner1273 13
  • If the game map is large, how do you set the initial position of the game window?

    If the game map is large, how do you set the initial position of the game window?

    If the game map is large, how do you set the initial position of the game window?

                                                                                                            very thanks
    
    type:new feature 
    opened by wonderfulLand 1
  • AStar pathfinder support 8 directions move, include diagonal cell

    AStar pathfinder support 8 directions move, include diagonal cell

    i find AStarMoveComponent moveToCell only support 4 directions (up down left right),so when the cell moving, it looks a little stiff. the code show that: Note: returned cells are in the grid (i.e. bounds are checked). Diagonal cells are not included. The order is left, up, right, down. so, could it support 8 directions move?
    thank u

    type:new feature 
    opened by haochisaka 1
  • build: Kotlin 1.7.10 -> 1.8.0, Jackson 2.13.4 -> 2.14.1, github-action checkout/setup-java/cache v1,v2 -> v3, Attach 4.0.15 -> 4.0.16

    build: Kotlin 1.7.10 -> 1.8.0, Jackson 2.13.4 -> 2.14.1, github-action checkout/setup-java/cache v1,v2 -> v3, Attach 4.0.15 -> 4.0.16

    Hi:

    Today, Kotlin and Jackson release new version jars and Jackson 2.13.4 has one vulnerability so we should better to upgrade it asap

    for github action, github action is deprecating checkout/setup-java/cache v1 & v2 so it has to upgrade to v3 otherwise the github action may not working in near future

    Cheers

    opened by chengenzhao 2
  • a problem  about physicsComponent

    a problem about physicsComponent

    Hello, I encountered a problem about physical components. My goal is to play a displacement animation when an entity is added. After the animation, add a physical component to it so that it can fall freely and have a speed. Now I have a problem that I can't set the speed after adding physical components. Maybe I can add physical components in the entitybuilder of this entity, but I don't know how to play a displacement animation easily. this is my code:

    
      override fun onAdded() {
            entity.zIndex = -1
           
     val type = entity.getString("type")
            entity.viewComponent.addChild(texture("map/item/$type.png"))
            val node = entity.viewComponent.children[0]
            val keyValue = KeyValue(node.translateYProperty(), node.layoutY -25.0)
            val keyFrame = KeyFrame(Duration.seconds(1.2), keyValue)
            val timeline = Timeline(keyFrame)
            timeline.play()
            timeline.setOnFinished {
                entity.zIndex = 0
                val physicsComponent = PhysicsComponent().apply {
                    setBodyType(BodyType.DYNAMIC)
                    addGroundSensor(HitBox("GROUND_SENSOR",  BoundingShape.box(37.0,37.0)))
                    setFixtureDef(FixtureDef().friction(0.0f))
                }
                entity.addComponent(physicsComponent)
                entity.getComponent(PhysicsComponent::class.java).velocityX=50.0
            }
        }
    

    this is the error: java.lang.IllegalStateException: Physics not initialized yet! Use setOnPhysicsInitialized() instead at [email protected]/com.almasb.fxgl.physics.PhysicsComponent.getPhysicsWorld(PhysicsComponent.java:59) at [email protected]/com.almasb.fxgl.physics.PhysicsComponent.getLinearVelocity(PhysicsComponent.java:239) at [email protected]/com.almasb.fxgl.physics.PhysicsComponent.getVelocityY(PhysicsComponent.java:220) at [email protected]/com.almasb.fxgl.physics.PhysicsComponent.setVelocityX(PhysicsComponent.java:208) at SuperMaLi/xbss.components.ItemComponent.onAdded$lambda-2(ItemComponent.kt:52) how can i handle this problem?Thanks!

    opened by Xiaobaishushu25 1
  • Support Isometric/ParallelCamera in 3D scenes

    Support Isometric/ParallelCamera in 3D scenes

    JavaFX supports the ParallelCamera, but FXGL is hard-coded to use the PerspectiveCamera in the Camera3D class. FXGL should allow users to use their own cameras such as the ParallelCamera

    type:new feature 
    opened by byteit101 2
  • InputModifier should include SHORTCUT(Ctrl on Win, Command on Mac) modifier?

    InputModifier should include SHORTCUT(Ctrl on Win, Command on Mac) modifier?

    Discussed in https://github.com/AlmasB/FXGL/discussions/1203

    Originally posted by chengenzhao August 27, 2022 HI:

    We just read the source code of FXGL and in the Triggers.kt there are some modifiers for the input modifier and when statement will match Keycode of modifiers to the input modifier but it only matches KeyCode.Ctrl to InputModifier.Ctrl I think it would be nice to have ShortCut in that clause also like:

    //KeyTrigger
            return when (event.code) {
                KeyCode.CONTROL, KeyCode.SHORTCUT -> modifier == InputModifier.CTRL
                KeyCode.SHIFT -> modifier == InputModifier.SHIFT
                KeyCode.ALT -> modifier == InputModifier.ALT
                else -> event.code == key
            }
    
    //MouseTrigger
        override fun isReleased(event: InputEvent): Boolean {
            if (event is KeyEvent) {
                return when (event.code) {
                    KeyCode.CONTROL, KeyCode.SHORTCUT -> modifier == InputModifier.CTRL
                    KeyCode.SHIFT -> modifier == InputModifier.SHIFT
                    KeyCode.ALT -> modifier == InputModifier.ALT
                    else -> false
                }
            }
    

    Because when people use Mac, they tend to use Meta(Command) key rather than Ctrl so it would be nice to have Short Cut in that clause also

    Thanks

    opened by AlmasB 0
Releases(17.2)
  • 17.2(Aug 20, 2022)

    Auto-generated changelog

    build

    • kotlin 1.5.32 -> 1.6.0 commit

    docs

    • Add Chinese README file (#1186) commit

    feat

    • the languages menu now displays the name in the target language, related to #1170 and #1172 commit
    • NotificationService now also accepts Node icon, closes #1149 commit
    • added WaypointMoveComponent which moves the entity based on Point2D, related to #980 commit
    • Input UserAction now provides API for double key/button presses commit
    • trigger listener now supports direct onKey and onButton callbacks which are triggered before the generic onAction callbacks, closes #1070 commit
    • Viewport::bindToFit for entities is now restored, closes #1036 commit
    • FrameData now supports offsets, closes #1181 commit
    • allow access to viewport camera entity via public API, closes #1168 commit
    • added support for Tiled 1.9.0 class property, #1182 commit
    • RechargeableDoubleComponent also has the value in percentage format as a binding commit
    • added KeepInBoundsComponent, fixed KeepOnScreenComponent, closes #842 commit
    • translate animation builder will use current position if from is not set commit
    • added EventBus.removeAllEventHandlers, #1160 commit

    fix

    • FPS camera now works even when mouse buttons are pressed, closes #1189 commit

    refactor

    • removed redundant onClick() since kotlin now properly reads Consumer<>, closes #1188 commit
    • use joints array size to track joint count commit
    Source code(tar.gz)
    Source code(zip)
    fxgl-17.2-uber.jar(19.20 MB)
  • 17.1(Mar 24, 2022)

    Auto-generated changelog

    build

    • javafx 17.0.0.1 -> 18 commit
    • gluon attach 4.0.9 -> 4.0.13 commit
    • junit jupiter 5.7.0 -> 5.8.2, junit platform 1.7.0 -> 1.8.2 commit
    • nexus staging 1.6.7 -> 1.6.8 commit

    docs

    • clarified that angle is in radians commit

    feat

    • added atDestinationProperty() to AStarMoveComponent, closes #945 commit
    • added QuestService.removeAllQuests() commit
    • added DSL API for world variable changes commit
    • startCutscene() now accepts an extra onFinished param, closes #1156 commit
    • added support for box2d prismatic joint commit
    • DialogService error dialogs will no longer show LOG button since these are for expected exceptions handled by dev, closes #1119 commit
    • added DSL support for loading common assets from URL, closes #971 commit
    • Tiled 1.4.2 support commit
    • .tmx level loader now supports polyline objects, closes #1133 commit
    • TransformComponent can bind its translate X Y Z to another TransformComponent commit

    fix

    • removing a ChoiceNode option now correctly disconnects the attached edge, closes #1122 commit
    • setting NotificationService background and text color now correctly updates the view, closes #1143 commit

    refactor

    • use Array to store Joints instead of manual linked list commit
    • refine Quest API commit

    test

    • improved test coverage for Inventory commit
    • added basic world non-null assertion for broadphase commit
    Source code(tar.gz)
    Source code(zip)
    fxgl-17.1-uber.jar(19.19 MB)
  • 17(Dec 31, 2021)

    Auto-generated changelog

    build

    • kotlin 1.5.10 -> 1.5.32 commit
    • maven pmd plugin 3.13.0 -> 3.15.0 commit
    • base Java 17, switch to 17+dev-SNAPSHOT commit
    • javafx 16 -> 17.0.0.1, closes #1107 commit

    docs

    • added commit message guidelines for changelog generation commit
    • clarified release process commit

    feat

    • FXGL 17 intro commit
    • added transferFrom() to Inventory commit
    • new API to set time to animation directly and to build sequential animations commit
    • dialogue syntax check, show an error icon if there are incomplete paths, #651 commit
    • added showChoiceBox to DialogService, closes #1094 commit
    • added audioFileName support to nodes, #651 commit
    • bind debug camera to CTRL+8, to avoid issues with CTRL+C commit
    • added DialogueContext, #1116 commit
    • added bulk dialogue editor actions commit
    • undo (ctrl+z) is complete for main editor actions, #651 commit
    • added TimeComponent::copy, #1041 commit
    • Added draft skybox implementation commit
    • add Platform.EMBEDDED, #1079 commit
    • added public API to change render fill of FXGLPane, set default to White for consistency with native mode, #1085 commit
    • added randomColorHSB() commit
    • added embeddedShutdown() that allows restarting an FXGL instance without the need to exit JavaFX, added sample, #1075 commit

    fix

    • fixed non-uniform frame distribution for AnimationTexture, closes #1067 commit
    • fixed a bug that causes audio service to not load properly on embedded devices commit
    • fixed a bug that would cause FS access via gluon attach on embedded devices commit

    refactor

    • internal refactor Inventory commit
    • clean up MDIWindow, closes #815 commit
    • remove redundant code, active is always false at that point, closes #1024 commit

    repo

    • ignore auto-generated changelog files commit
    Source code(tar.gz)
    Source code(zip)
    fxgl-17-uber.jar(19.44 MB)
  • 11.17(Jul 16, 2021)

    • Added download file API to NetService
    • Rotation and scale in 3D now support origin points (pivot points)
    • Added a setting that allows music to be paused when the game is minimized, paused by default
    • Added Model3D sample showing how to load .obj models
    • Added JointSample and support for RevoluteJoints from box2d
    • Added fluent API to HearingSenseComponent, thanks to @jo372
    • Updated physics collision sample, thanks to @jo372
    • Ignore and warn during when adding a component during a component update, thanks to @lydianeU
    • Added PropertyMapChangeListener
    • Added replication support for PropertyMap
    • Camera in 3D has a new setting allowing the pitch (rotationX) to be clamped between -90 and 90 deg
    • Multiple superfluous modules merged into few

    Bug fixes:

    • AutoRotationComponent smooth now shouldn't make sharp turns

    Version bump:

    • jacoco 0.8.6 -> 0.8.7
    • kotlin 1.4.30 -> 1.5.10
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.17-uber.jar(19.39 MB)
  • 11.16(May 25, 2021)

    • Restored and refactored MultiplayerService
    • Added ReplicationEvent (javafx event that can be replicated on a remote machine)
    • FPS camera (camera3D.setFPSCamera(true))
    • Mouse sensitivity setting
    • Removed dependency on javafx.swing module, thanks to @FDelporte
    • Performance improvements in Tiled map loading, thanks to @adambocco
    • isExperimental3D -> 3D
    • isExperimentalNative -> isNative
    • Model3D can be loaded from an .obj
    • Model3D now has a copy()
    • Added Cuboid shape
    • EntityGroup::size(), thanks to @adambocco
    • Allow providing a custom default cursor for all scenes
    • Internal physics refactoring
    • Entity no longer throws an exception when adding a duplicate Component (warns instead), thanks to @Zhack47

    Version bump:

    • JavaFX 15 -> 16
    • Compile target for Kotlin: 1.8 -> 11
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.16-uber.jar(19.63 MB)
  • 11.15(Apr 13, 2021)

    • Custom 3D shapes
    • Allow users to set render width/height when running in embedded mode
    • Game world is less aggressive and warns the user instead when an illegal operation is attempted
    • Added cutscene text format: cutscenes can have author names and images
    • Internal refactorings for physics code
    • Significant performance improvements for collision checks where both entities are at 0 rotation
    • Merged standalone modules
    • Logger prints full stack trace for caught exceptions
    • Draft API for downloading files
    • Screenshot key is now CTRL+8 to avoid issues with P
    • Bug fixes related to mouse UI coordinates
    • Tiled tile flipping support, thanks to @adambocco
    • Initial draft of SenseAI
    • Initial draft of fxgl editor
    • jackson 2.11.1 -> 2.12.1
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.15-uber.jar(19.60 MB)
  • 11.14(Mar 1, 2021)

    • Major internal refactoring of physics (both light and heavy-weight). Please check your physics related code behaves the same
    • Significantly improved physics performance of collision detection when at least one entity is at non-zero rotation
    • Added experimental embedded mode support, where FXGL can run inside a JavaFX application natively via a Node
    • AssetLoader can now load from any URL, thanks to @sormuras for discussions
    • Added loadJSON() to asset loader
    • Renamed master branch to release to clearly represent branch purpose
    • All of CI is now on GitHub Actions
    • Inventory feature improvements, thanks to @adambocco for PRs
    • Kotlin: 1.4.10 -> 1.4.30

    Bug fixes:

    • Fixed a bug in event handling for Input. Now filters and handlers behave a similar way to JavaFX
    • Fixed a bug that would case loop runner to speed up after pause / delay / resume sequence
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.14-uber.jar(19.40 MB)
  • 11.13(Jan 26, 2021)

    • Introduction of experimental 3D concepts, such as transforms, camera and scene. FXGL now understands 3D for purposes of rendering and animating.
    • z is now used for the depth dimension. Use zIndex to change z-index of entities
    • Significantly simplified Menu API
    • Added AnimatedString
    • Added RandomAStartMoveComponent
    • Added multiple new samples
    • Added CODE_OF_CONDUCT
    • Allow providing a custom startup scene
    • Number of ticks can now be set to arbitrary (does not depend on display refresh rate)
    • Updated color scheme for .fxgl_button (FXGLButton)
    • Updated documentation of multiple modules, see #897

    Bug fixes:

    • PropertyMap will now correctly notify when setting an object (same ref)
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.13-uber.jar(19.32 MB)
  • 11.12(Dec 11, 2020)

    • Expose engine pause/resume and primary stage as public API
    • Fixed a bug that would crash dialogue editor with many graph nodes
    • Fixed a bug that crashed dialogue cutscene when a choice response was pressed before the text animation finished
    • Fixed a bug in dialogue editor related to saving / loading
    • New setting: disables auto-scale on resize. Useful for non-game applications
    • Support for assignment statements in dialogues (in FunctionNode)
    • Support for Tiled text objects
    • Support for high-refresh rate displays: please test
    • Support for audio on Android
    • Support for adding a custom buffer size for UDP packets
    • Improved profiling tools for FPS, CPU and RAM
    • Tentative controller support for windows64 and linux64: QA testing is welcome!
    • Internal code quality improvements
    • More unit tests
    • Faster CI builds due to removal of unnecessary actions
    • Partial CI migration to GitHub Actions
    • kotlin 1.3.41 -> 1.4.10
    • javafx 14 -> 15
    • jacoco 0.8.5 -> 0.8.6
    • junit 5.6 -> 5.7
    • attach 4.0.8 -> 4.0.9
    • Other minor improvements
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.12-uber.jar(19.32 MB)
  • 11.11(Sep 8, 2020)

    This release brings mobile (via Gluon client-maven-plugin) and networking support.

    • TCP support is no longer in draft (feedback welcome)
    • Added draft UDP support
    • Restored FXGLTextFlow
    • AnimationBuilder now has rotate and scale origins, thanks to @AahzBrut
    • Fixed WobbleEffect, thanks to @AahzBrut
    • Various API improvements
    • More tests
    • attach 4.0.6 -> 4.0.8
    • javafx 13.0.2 -> 14
    • Improved peformance in IntroScene
    • Added lifecycle event handlers on mobile
    • Significant performance improvements to Images::merge and sub/superTexture
    • Fixed default logging format
    • Clean up CI scripts

    FXGL dialogue editor:

    • can move multiple nodes with CTRL+click
    • latest builds available from builds-editor
    Source code(tar.gz)
    Source code(zip)
    dialogue-editor.png(579.11 KB)
    fxgl-11.11-uber.jar(19.27 MB)
    fxgl-dialogue-editor-1.0-beta-win.zip(37.55 MB)
  • 11.10(Jul 31, 2020)

    Changelog:

    • Default intro scene updated
    • Draft of fxgl-net TCP
    • Significant improvement in animation performance
    • Anonymous components are now allowed, though still not recommended
    • Component injection can be disabled on a per component basis to improve runtime performance when creating many entities
    • fxgl-trade module is now part of FXGL API
    • Added "global" input object accessible via SceneService
    • More tests
    • Internal code cleanup and refactor
    • fxgl-samples cleanup
    • attach 4.0.2 -> 4.0.6
    • new dep: jackson databind
    • Dialogue editor: added branches / functions / conditions
    • Added a setting to disable all FS write operations
    • Localizations and fonts are now lazily loaded, improving fxgl startup time
    • Camera scene can be entered with CTRL+C in debug / developer modes

    Bug fixes:

    • Fixed translation animation along a path, which now doesn't snap to 0,0
    • Fixed a bug where tmx with different tileset sizes would load incorrectly
    • Fixed a bug where viewport would not correctly follow entity if zoomed
    • Fixed a bug where mouse world coordinates would be incorrect when viewport is zoomed
    • Fixed a bug where viewport bounds would not honor zoom level
    • Fixed a bug where resized window would generate incorrect input coordinates

    Contribution credits (thanks to):

    • @dykstrom
    • @AahzBrut
    • @CharlyZhu
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.10-uber.jar(20.55 MB)
  • 11.9(May 27, 2020)

    Changelog:

    • Error reporter is no longer a native window. It now runs as an MDI window to improve cross-platform support
    • Animation now has an onCycleFinished() callback
    • Single unified AnimationBuilder for Entity and Node, available for all fxgl modules
    • .properties or any extension with same properties format can be loaded as a PropertyMap
    • Redesigned menu architecture: now there are only two menus: main and game, each controlled separately via settings.setMainMenuEnabled() and settings.setGameMenuEnabled().
    • Fixed a bug that incorrectly sorted the rendering order of subscene views
    • Fixed a bug that incorrectly resized scenes
    • More detailed OS info is logged to debug (thanks to @ross-holloway94)
    • New input trigger: sequence of keys
    • New components: AutoRotationComponent, StateComponent
    • New Entity and Animation builder convenience methods
    • Improved internal management of entity views, resulting in significantly improved use of CPU time (especially when there are many entities)
    • Simplified Save/Load API
    • Improvements to Shop API in the fxgl-trade module
    • Improvements to Entity API for kotlin users (thanks to @wakingrufus)

    Mobile improvements:

    • no extra IO tasks during FXGL init (faster startup)
    • no runtime proxy functions (avoids mobile runtime crash)
    • .tmx is now correctly parsed
    • platform os is correctly detected
    • virtual joystick
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.9-uber.jar(18.63 MB)
    fxgl-dialogue-editor-win-0.1.1.zip(39.05 MB)
    fxgl_dialogue_editor-win-0.1-SNAPSHOT.zip(46.55 MB)
  • 11.8(Mar 8, 2020)

    • Most FXGL.* calls are implemented as EngineService for further modular architecture
    • getGameState() is now a property map of the game world, accessible via FXGL.getWorldProperties()
    • Fonts are loaded lazily. Now getUIFactoryService().newText() has unmodifiable fonts
    • Faster window startup
    • New events DSL API
    • New Action API for entities. An Action is short-term behavior.
    • JavaFX Properties can now be animated using the Animation DSL API
    • WobbleEffect
    • JavaFX upgraded to 13.0.2
    • New function to calculate distance between bboxes of entities
    • Minor convenience updates to API

    Fixes:

    • Fixed z-index sorting bug when z is updated at runtime
    • Fixed incorrect offset of the pause menu when window is resized
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.8-uber.jar(18.62 MB)
  • 11.7(Jan 5, 2020)

    Main focus of this release was on the fxgl-ai module. In particular, A* pathfinding and cell-based movements. Changelog:

    • Added fxgl-ai module
    • ProgressBar (fxgl-ui module) value not bindable was fixed (thanks @marvinbuff )
    • Particle effects can now scale with entities
    • Images.kt has new resize() function (thanks @CharlyZhu)
    • Cursor can now be set to invisible in the game scene
    • Added IntervalSwitchComponent (thanks @CharlyZhu)
    • Added TrailViewComponent
    • Added PropertyMapView (thanks @CharlyZhu)
    • FXGLMath random can now be initialized with a seed (settings.setRandomSeed())
    • Minor bug fixes and extra convenience methods to Java and Kotlin DSL
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.7-uber.jar(18.57 MB)
  • 11.6(Nov 17, 2019)

    • Unified localization support for both in-game and engine data. Example usage:
    getLocalizationService().addLanguageData(new Language("ENGLISH"), Map.of("some.key", "Hello World"));
    // just String
    String s = getLocalizationService().getLocalizedString("some.key");
    // a bindable StringProperty
    StringProperty s = getLocalizationService().localizedStringProperty("some.key");
    
    • Support for flipped tiles in .tmx files from Tiled map editor
    • Tiled maps with transparency are now correctly loaded
    • Added circuit breaker style mini game
    • Allow entities to call component methods directly using method name:
    class SomeComponent extends Component {
        public void someMethod() { }
    }
    ...
    entity.addComponent(new SomeComponent());
    entity.call("someMethod");
    
    • Added components: ActivatorComponent, FollowComponent, TextViewComponent, GenericBarViewComponent (thanks to @marvinbuff}
    • Added effect: SlowTimeEffect
    • Fixed a rare bug that would crash FXGL on startup
    • More tests
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.6-uber.jar(18.51 MB)
  • 11.5(Sep 22, 2019)

    This release fixes a major bug in fullscreen mode. All developers using fullscreen in their games should upgrade to this version.

    • Fixed UI not scaling properly when going fullscreen
    • Fixed (via a workaround, thanks to @Madave94) uncapped frame rate on Linux
    • Larger code coverage for unit tests + added a system test
    • Internal code refactorings to reduce inter-class dependencies
    • Cleanup of legacy code and resources
    • Added static code analyser (thanks to @megaman248)
    • New fxgl-tools module with functional dialogue editor
    Source code(tar.gz)
    Source code(zip)
  • 11.4(Aug 6, 2019)

    This release completes a lot of the groundwork required to run FXGL 11 natively (desktop + mobile).

    Changelog:

    • The engine core is fully functional on native Linux, Mac + iOS
    • File system access now works on iOS via "attach" storage 4.0.2
    • Most of fail-fast calls in AssetLoader are now fail-safe: dummy assets are returned if load fails and a warning message is recorded
    • Deprecated API has been removed
    • New setting to preserve resize ratio
    • Add build number, java and javafx runtime versions to FXGL version
    • Developer debug messages that can be used for temporary messages
    • Added OffscreenPauseComponent
    • Restored virtual controls
    • Menu UI bug is fixed wrt credits
    • ViewComponent API is redesigned to be more intuitive. Access to underlying view (JavaFX Node subclasses) should now be easier. Adding and removing views at runtime should also be easier.
    • Uses JavaFX 12.0.1
    • Travis CI now uses OpenJDK11 and 12
    • Uber jar now contains all (win, mac, linux) dependencies
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.4-uber.jar(18.23 MB)
  • 11.3(May 31, 2019)

    This is the first stable release for FXGL 11. All Java 11 users should update to this version.

    Changelog:

    • Animation channels can be constructed from sprite sheets with different frame sizes
    • Extra built-in components: LiftComponent, DraggableComponent, IntervalPauseComponent
    • Restored onPreInit() for single pre-init tasks
    • Improved Java module names (thanks to @sormuras )
    • Documentation cleanup in various modules
    • New modules: minigames and trade (these are WIP and are not yet used by the main module)
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.3-uber-win.jar(14.53 MB)
    fxgl-11.3.1-uber-linux.jar(16.42 MB)
  • 11.2-beta(Apr 28, 2019)

    • New developer pane
    • New service API
    • Tentative architecture for Notification and Achievement services
    • Fixed problems with scaling of polygonal shapes and hit boxes
    • Input now correctly reports onActionEnd() if a scene is switched
    • Collision handlers now correctly report onCollisionEnd() if an entity becomes ineligible for collision while colliding
    • Fixed check for web platform
    • Minor bug fixes
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.2-beta-uber.jar(14.52 MB)
  • 11.1-beta(Mar 17, 2019)

    • Tiled 1.2.3 integration (.tmx spec 1.2)
    • Larger code coverage
    • Fixes in the animation, input modules
    • Copying components is no longer supported by design. Now you should respawn entities instead, which is a much safer and cleaner alternative.
    • JavaFX 11.0.2
    • Improved Kotlin dsl support
    • Restored extra components: EffectComponent, KeepOnScreenComponent, ExpireCleanComponent, OffscreenCleanComponent. They are now located in com.almasb.fxgl.dsl.components, where all new components will be added. The entity module only has core components now.
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.1-beta-uber.jar(14.41 MB)
  • 11.0-alpha(Feb 10, 2019)

    • Java / JavaFX 11 support
    • Modular architecture
    • TransformComponent. This now correctly affects the bounding boxes and view.
    • All convenience calls have been moved to FXGL., e.g. FXGL.getGameWorld().
    • Entity / animations builders now available via FXGL.entityBuilder() / FXGL.animationBuilder() and provide a common API
    • Many features removed to focus on the core. As development continues, the features from 0.5.4 will be reintroduced with a thoroughly designed API.
    Source code(tar.gz)
    Source code(zip)
    fxgl-11.0-alpha-uber.jar(14.39 MB)
  • 0.5.4(Aug 25, 2018)

  • 0.5.3(Jul 8, 2018)

    • Particle system can function standalone
    • Particles can now rotate based on their velocity
    • Upgraded Main Menu visuals
    • Ability to ignore certain collision pairs
    • Ability to access VirtualController parts separately
    • Simplified settings configuration
    • New font types: game and text
    • Improved support for Tiled objects (rotation field + polygon shape)
    • Automated image generation from 9 slices
    • Bug fixes related to game and physics worlds
    Source code(tar.gz)
    Source code(zip)
    fxgl-0.5.3-uber.jar(10.03 MB)
  • 0.5.2(Jun 1, 2018)

    • Virtual controller (mobile-friendly) that integrates with existing input mechanism
    • DraggableComponent - allows dragging any entity with mouse or touch (mobile)
    • Developer menu option to show entity positions and anchor points
    • Localized most text and updated translations to German (thanks to @ZacharyDSturtz)
    • Ability to add custom box2d sensors
    • Improved integration with box2d
    • Entity toString() is more developer-friendly
    • Automated uber-jar builds are commited to builds
    Source code(tar.gz)
    Source code(zip)
    fxgl-0.5.2-uber.jar(9.77 MB)
  • 0.5.1(May 7, 2018)

    • iOS support (alpha)
    • File system is mobile-friendly
    • Improved error reporter: the messages are more relevant and easy to read
    • Updated MDI window icons
    • Properly parse Tiled "gid" and "name" properties
    • WIP large Tiled map support
    • FXGL now launches on the JavaFX thread
    • Splash screen is part of the main window
    • Better coverage of com.almasb.fxgl.entity.*
    • RenderLayer is now a class
    • Polygon bounding shape
    Source code(tar.gz)
    Source code(zip)
    fxgl-0.5.1-uber.jar(9.75 MB)
  • 0.5.0(Apr 14, 2018)

    This is a major release that contains significant improvements and API changes:

    • Android support with zero code change
    • Web support (alpha, only core features) with zero code change
    • PropertyMap data structure for observable values, now backs FXGL / Entity / Game properties
    • Reduced a lot of duplicate code by merging Component and Control into a single concept (everything is a Component)
    • Can use multiple entity factories
    • Improved particle system performance
    • Improved sprite sheet animations, especially with multiple states
    • API restructure and rename for clarity
    • Minor bug fixes
    Source code(tar.gz)
    Source code(zip)
    fxgl-0.5.0-uber.jar(9.70 MB)
  • 0.4.3(Mar 3, 2018)

  • 0.4.2(Feb 3, 2018)

    • External game config classes (configure game variables with no recompilation)
    • Scripts (JS) now have local scopes (each script instance has global variables that are local to that instance)
    • Support multiple versions for Tiled .json format
    • Foundation codebase for PCG maps and levels
    • SNAPSHOT builds are released automatically after each successful Travis-CI build, add:
    <repositories>
        <repository>
            <id>oss.sonatype.org-snapshot</id>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>
    

    and you can use x.y.z-SNAPSHOT.

    Source code(tar.gz)
    Source code(zip)
    fxgl-0.4.2-uber.jar(9.93 MB)
  • 0.4.1(Dec 31, 2017)

    • Dynamically resizable game window
    • Dynamic full screen support
    • Texture colors can now be replaced on the fly
    • Improved scripting support (now includes the ability to write scripts for entity events)
    • Added translational and rotational viewport "shake" effect
    Source code(tar.gz)
    Source code(zip)
    fxgl-0.4.1-uber.jar(9.91 MB)
  • 0.4.0(Nov 21, 2017)

    This is a major release that includes following features:

    • Single step the main loop
    • ECS has been reworked to simplify API
    • Powerful blending functions for textures
    • Localization (French, Russian, German)
    • Xbox One style notifications
    • Far Cry Primal style input view
    • Tiled object properties now automatically parse into Entity properties
    • Fixed: high GPU usage when nothing is rendered
    • Fixed: high CPU usage when the game is minimized
    • Fixed: logging errors when used from multiple threads
    • Fixed: incorrect hit box placement when bounding box didn't start at local x = 0
    • lots of other bugfixes and minor features
    Source code(tar.gz)
    Source code(zip)
    fxgl-0.4.0-uber.jar(9.75 MB)
Owner
Almas Baimagambetov
Senior Lecturer in Game Development at the University of Brighton. A passionate software developer. PhD in Computer Science.
Almas Baimagambetov
A simple puzzle game made with Unity to practice the game engine

A simple puzzle game made with Unity to practice the game engine.

Eyüb Salih Özdemir 1 Mar 30, 2022
A Java Game Engine created in Java with LWJGL!

?? Suffler Engine Suffler Game Engine is an engine created in java using OpenGL to Graphics. Currently being developed at Eclipse, and Visual Studio C

Suffler Engine 2 Jul 23, 2022
A Java Swing based game engine

faypixelengine A Java Swing based game engine What is it? A Java game engine that uses swing and can be used to develop interactive games. The idea fo

null 9 Aug 26, 2022
LITIENGINE is a free and open source Java 2D Game Engine

LITIENGINE is a free and open source Java 2D Game Engine. It provides a comprehensive Java library and a dedicated map editor to create tile-based 2D games.

Gurkenlabs 572 Jan 7, 2023
Orbital a java 2D game engine

Orbital Orbital is a under-development 2D game engine. Installation Orbital is avaliable on Jitpack. See below for the installation: Gradle allproject

null 22 Dec 12, 2022
2048FX - The game 2048, built using JavaFX and Java 11

The game 2048 built using JavaFX 16 and Java 17.

Bruno Borges 261 Dec 28, 2022
BattleShip-Game - This repository contains the code of the BattleShip (Bataille Navale) game programmed in Java.

Bataille Navale Auteur : SABIL Mohamed Amine Comment générer la documentation ? Placez vous dans le sous-dossier src : pour générer la documentation d

Mohamed Amine SABIL 1 Jan 4, 2022
Snake-Game - A simple snake game written in java.

What's this? A simple snake game written in java. How to play Download the latest release. Ensure that a compatible java runtime is installed (optimal

Patrick260 4 Oct 31, 2022
Othello PvP (2-Player) Game Application created in Java using Swing and AWT, for playing the Othello game

Othello PvP (2-Player) Game Application created in Java using Swing and AWT, for playing the Othello game, a simple game that played on an 8 by 8 checkered board with 64 double-sided black and white discs. The game is easy to learn, but it takes time to master and develop winning strategies.

Soumyadeep Pal 1 Feb 28, 2022
A game made in Javafx that includes animation, background music, and view leaderboards

A game made in Javafx that includes animation, background music, and view leaderboards. To keep the game alive, a player has to move the ball up/down by pressing the up/down arrow so that the ball only touches different rotating obstacles with the same color. ..

Bijendar Prasad 3 Nov 19, 2022
JavaFX & FXGL Game: Mario; Add New Levels.

FXGL_Mario Game Game Video This project is only used for learning JavaFX and fxgl technology; Pictures, sounds and other materials should not be used

null 8 Nov 7, 2022
The game is a 2D side scrolling system, where a player moves left, right, vertically or diagonally to traverse the game.

The game is a 2D side scrolling system, where a player moves left, right, vertically or diagonally to traverse the game.

Ravi Mandal 7 Sep 11, 2022
A basic representation of the 0-player game, "Game-of-Life", a simple example of basic cellular automata

Game-Of-Life-Basic A basic representation of the 0-player game, "Game-of-Life", a simple example of basic cellular automata. A cellular automaton is a

Nikhil Narayanan 5 Oct 27, 2022
[LEGACY] LWJGL 2.X - The Lightweight Java Game Library.

[LEGACY] LWJGL - Lightweight Java Game Library WARNING This is the repository of the original LWJGL, which is no longer actively maintained. Unless yo

Lightweight Java Game Library 529 Dec 26, 2022
A 2d Java physics engine, native java port of the C++ physics engines Box2D and LiquidFun

jbox2d Please see the project's BountySource page to vote on issues that matter to you. Commenting/voting on issues helps me prioritize the small amou

jbox2d 1k Dec 27, 2022
Duck Library is a library for developers who don't want to spend their time to write same library consistently.

Duck Library is a library for developers who don't want to spend their time to write same library consistently. It has almost every useful feature to

null 5 Jul 28, 2022
Golden Axe (1989) game implemented in java using only standard libraries (Java 2D, Swing, AWT & Java Sound API)

Golden Axe (1989) game implemented in java using only standard libraries (Java 2D, Swing, AWT & Java Sound API), so no external libraries required. Video: https://youtu.be/uevIVLNhQqs

Leo 101 Jul 21, 2022
It is a simple java terminal game. I built it in order to practice my code skills that I obtained while I was learning Java.

Java-terminal-game It is a simple java terminal game. I built it in order to practice my code skills that I obtained while I was learning Java. The ga

Baistan Tashkulov 0 Jan 20, 2022
A modern engine for modded Minecraft.

Flywheel A modern engine for modded Minecraft. About The goal of this project is to provide tools for mod developers so they no longer have to worry a

null 136 Dec 30, 2022