Questions tagged [javafx]

The JavaFX platform enables developers to create and deploy Rich Internet Applications (RIA) that behave consistently across multiple platforms and browsers. JavaFX 1.3 and older, were scripting languages, whereas JavaFX 2.x+/8.x enables users to use Java. FXML enables JavaFX to follow MVC architecture.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Having trouble creating an unbound game using FXGL

I am trying to recreate a game like Splix.io using FXGL, I have implemented the logic of the game for one player and it works. And for my game window I am using a 800*800 window. My problem is my game ...
Pourya Aliannejadi's user avatar
1 vote
0 answers
52 views

i have a strange bug with collision, is there any way around this or do i have to pick a different method?

so lately i've been learning about abstract classes and interfaces, and i saw a neat yt video about falling sand games (think Noita) so i wanted to take a crack at it as some particles share a ...
Potat.OS1's user avatar
0 votes
1 answer
579 views

2d zooming function using transformation matrix

I'm trying to create a sort of "graphing calculator coordinate system" where you can zoom into a point by scrolling with the mouse wheel. I'm using javafx's transformation matrices (Affines) ...
user156844's user avatar
0 votes
1 answer
842 views

Changing ImageView position based on angle of rotation

I am trying to make an ImageView change its position based on the direction it is facing. ...
qwerty's user avatar
  • 101
0 votes
1 answer
620 views

Adding JavaFX GUI to an MVC based terminal card game

I have written a version of Castle that so far plays through the terminal. I have recently refactored my code (which can be found here) to use the MVC design pattern. After I have added a GUI I will ...
theJavaGuy's user avatar
1 vote
0 answers
545 views

2-player online card game architecture [closed]

This is the first game I have developed. Please correct me if I'm mistaken. I want to build an online 2-player turn based card game (Shithead). I want to code it in Java as that is what I have most ...
theJavaGuy's user avatar
0 votes
1 answer
2k views

How to reset snake in javafx game?

I am making snake in javafx, I have completed my game, and I am trying to add a reset button in my game. When I click the reset key (ENTER), the game should reset, but the arraylist that stores the ...
PaulBlart's user avatar
3 votes
1 answer
667 views

How to structure tic tac toe game loop (or equivalent simple turn based game)?

I'm developing the simple Tic Tac Toe game in Java and got stuck on the game loop architecture. The game must support local, remote and automatic players. The graphical interface is based on JavaFX. ...
Sebastiano Verdolini's user avatar
2 votes
0 answers
48 views

Lighting not working in a 2D JavaFX game when using subtracting shapes?

So im trying to add lighting into my game. I'm using shape subtracting and unions to subtract circles (the lights) from a dark rectangle that covers the whole world. I think that its a problem with ...
Superhuman's user avatar
1 vote
1 answer
343 views

How to add lighting to a 2D Tile-based game in JavaFX?

I'm making a 2D roguelike tile-based game with Java and JavaFX. I'm currently working on adding lighting and darkness to the dungeon, but whenever I try running it, it takes a very long time to load, ...
Superhuman's user avatar
0 votes
0 answers
101 views

Creating method to jump over another pawn

Currently, I am working on my very first bigger project in Java. It is a simple checkers game, which is based on GridPane. For now, everything is more than fine, ...
Fishy_Code's user avatar
1 vote
1 answer
189 views

How to control JavaFX's animations execution order when animations "queue" is being altered in run-time?

What is the proper way of handling synchronization between GUI animations' execution order and the user's dynamic input? More specifically, I would like to know how to enforce some logical ...
Julian Broudy's user avatar
0 votes
1 answer
362 views

Snake game steering with Java FX

I am currently trying to make a snake game with Java FX, I read several posts about it and I understand on theory how to move the snake body (for each part of the snake reference the previous one and ...
Mat Ertonn's user avatar
0 votes
1 answer
512 views

JavaFX AnimationTimer VS Swing Game Loop

After looking at some code sources out there I noticed Java Swing Games usually create a class implementing Runnable, create a new Thread and set up the game loop ...
Jean Henry's user avatar
0 votes
2 answers
4k views

JavaFX - How do I create a health bar?

I tried searching online on how to implement health bar with Java FX in a 2D side-view Java fighting game but I can only find those that goes with 'awt' and 'Swing'. The health bar I'm picturing are ...
WCKennedays's user avatar
0 votes
2 answers
571 views

Breakout paddle bouncing

I am having trouble with making a Breakout Clone using JavaFX. I have almost everything working, but I have a problem with the physics of the ball after it bounces off of the paddle. I used this ...
MattChris's user avatar
  • 103
0 votes
2 answers
974 views

How to locate assets on different computers? JavaFX

i've programmed a little game in javafx in Eclipse. It uses 3 file-path url's to locate the images, sounds and savefile folders. My problem is that those url's have been hardcoded and therefor ...
Thomas Linssen's user avatar
2 votes
1 answer
1k views

How to render a large tile-based 2D world efficiently (using JavaFX/ScalaFX or more generally)

I have a file tileset.png containing a dozen 32*32 tiles. When my game starts, it generates the world randomly with the available tiles and the size of the world ...
Yksuh's user avatar
  • 21
1 vote
0 answers
168 views

Is there a common library for key listener for Java?

I'm making a game engine which supports Swing and JavaFX at the same time. I provided key listener APIs like this: Swing ...
ice1000's user avatar
  • 286
1 vote
1 answer
1k views

How can I `draw` something on a JavaFX WritableImage?

I'm migrating a project from Swing to JavaFX, and I have a problem. Since java.awt.BufferedImage provides getGraphics and it has ...
ice1000's user avatar
  • 286
3 votes
0 answers
984 views

JavaFX import 3D models

I want to import some 3d models to my javaFX application. In javaFX I can create rectangles, traingles, circles, pentagons. Those figures can be filled with color or filled with image. They are ...
Aš Gražus Tamsoje's user avatar
0 votes
1 answer
1k views

JavaFX snake game AI

I am trying to add an AI simulated snake to my snake game that a player can play against. So far I think I do get the concept of how to do certain things but snake should be able to find the nearest ...
Eudy Contreras's user avatar
0 votes
1 answer
350 views

Rotations of a Rubik's cube

I made a Rubik's cube by arranging smaller cubes. Now I want to apply animations to it. For that I am choosing to use the Rotate class and set the angle of rotation ...
Debarun Mukherjee's user avatar
0 votes
1 answer
392 views

Rotation of a cube

I came across the statement "rotation about a pivot and an axis" in javafx. The axis is defined byPoint3D and the pivotX, pivotY and pivotZ are of ...
Debarun Mukherjee's user avatar
1 vote
2 answers
643 views

Applying animations to 2x2 Rubik's cube

I built a 2x2 Rubik's cube with javafx and my next goal is to apply animations to it. For that I need to keep track of the individual cubes. But I could not find one. Then I simply set up four ...
Debarun Mukherjee's user avatar
2 votes
1 answer
2k views

How to calculate texture coordinates for a cube?

I was reading about texture mapping on 3D shapes in javafx where I came across this code, ...
Debarun Mukherjee's user avatar
1 vote
1 answer
895 views

how to get rid of blurred and overlaping 3d shapes in javafx

I actually wanted to build a 2x2 rubiks cube. As the Box class in javafx doesn't provide the feature of building a cube with different colours on different faces, I chose to build the cubes using ...
Debarun Mukherjee's user avatar
1 vote
1 answer
2k views

How do you rotate all the objects around the camera?

If I'm correct, the way that you can "look around" in an environment is that you rotate all the objects around the camera. This is the code that I've created using JavaFX 3D. So what's the algorithm? ...
SirMathhman's user avatar
0 votes
1 answer
1k views

Setting the cursor's location in JavaFX

Is there a way to set the cursor's location in JavaFX while the window is in focus? I've searched the possibility of the Scene's cursor object, but that leads to a dead end.
SirMathhman's user avatar