Java is both a popular object-oriented programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.
1
vote
1answer
39 views
Just how expensive is it to bind textures in OpenGL? (LibGDX)
I'm using LibGDX on top of OpenGL and currently my game engine does something along the lines of the following per frame
Bind a terrain texture sprite atlas and a set of transparency masks in ...
-1
votes
0answers
33 views
JPanel vs Canvas? [on hold]
The reason I'm asking this is because in the tutorial I'm following it uses Canvas but and in a section it goes like this: BufferStrategy bs = this.getBufferStrategy(); followed by Graphics g = ...
0
votes
2answers
70 views
Java, spawn algorithm that gets harder each level
I am currently in the process of making my 3rd Java game (everything I have learned is from YouTube videos, so I may be doing some things wrong) named "Blocked". But I have run into a problem: how do ...
0
votes
1answer
41 views
Game puzzle pop in java
I am making a game in Java based of those puzzle popping games.
The objective is to select with the mouse and remove a tile. The game i want to build.
I have a JPanel and on top, several Components, a ...
0
votes
0answers
24 views
How can the new Yggdrasil Minecraft authentication be utilised in java?
A while ago I had a custom launcher for my modpack in minecraft and it used the old login.minecraft.net method of authentication but now I see they have changed this method. Here is a link to the new ...
0
votes
2answers
64 views
How is it possible to call abstract methods from another class? [on hold]
Im creating a game using LWJGL and just as a bit of organising I made an Abstract class called Game so I could extend Game in my main class The game class is like so -
public abstract class Game {
...
0
votes
0answers
23 views
Random distribution of chess pieces (Chess960/Fischer Random Chess) [on hold]
I am new to Java(2 weeks training only) and tried to create a simple Java game and implemented an AI. Learning Java all by myself, I followed a few guidelines online and have come up with something ...
0
votes
0answers
30 views
How do I fix a delay between the first and second KeyEvent
I recently got really interested in making my own little game. As I have no real game development background I'm still figuring stuff out, but I encountered a little problem.
While working on the ...
-1
votes
0answers
33 views
How to create Java graphics like these in Nexus wallpaper [on hold]
How could I create flying cubes (like these ones in Nexus wallpaper) in Java Graphics (or Paint/whatever)? I mean the cubes and their fades. Also, I would welcome the least memory usage solution.
...
0
votes
1answer
32 views
How to export slick2d game into a jar with the res and native folder
I am a beginner in Slick2D.
I use jarsplice to output Slick2D game.
But it is export all thing into one jar.
I want to export one jar with the res and native folder ....
So I can easily modify ...
0
votes
1answer
39 views
TliedMap render use 15%cpu
I am a beginner in Slick2D.
I used TiledMap render in my game,but I do not know why it use 15%cpu and how to fix it.
I used map is 1024*768.
This is a part of my code.
Thanks for any help
public ...
0
votes
0answers
16 views
LWJGL Not Rotating Properly
I'm making a Rubik's Cube in LWJGL but the cubes don't seem to be rotating correctly. The original without any rotation is fine. After one rotation:
This is also correct but the problem comes from ...
0
votes
1answer
22 views
Random black screen when changing states
I'm making a game with LibGDX but I ran into a really odd problem.
When I was working on the loading screen I delayed the loading process with an image of ~87MB. When the loading is finished, it ...
-3
votes
0answers
19 views
Java chess game [closed]
I am making a chess game in Java like MyChessmate: https://github.com/melvic-ybanez/my_chessmate/tree/master/src/mychessmate
I am implementing the OOP concepts and would like to know how I can ...
0
votes
1answer
19 views
Libgdx - changing tiledmap smoothly, Tween engine maybe?
First question here, so bare with me if I make a mistake or two. Long story short I'm currently developing a side scroller game in java with libgdx, which uses tiledmaps from the tiledmap creator ...
0
votes
1answer
13 views
LibGDX - Shader not being applied
I've recently encountered a strange problem with my program and I can't seem to fix it. When I try to apply a shader to my SpriteBatch it doesn't change. I've debugged this problem like so:
if (test) ...
1
vote
0answers
43 views
What is the most efficient way to store world data for a 2D tile game? [closed]
I'm working on a 2D tile based survival game for my programming class and as I was working on GUIs I realized that I would need an efficient way of storing and recalling not only the tile data and ...
1
vote
1answer
35 views
How to jump in Box2D with LibGDX
I am making a 2D platformer in LibGDX with both Ashley and Box2D.
I have it so, that the PlayerControllerSystem watches for the jump key being pressed:
// Jumping
if ...
4
votes
2answers
150 views
Poor performance wth custom particle system in LibGDX
I'm using a custom particle system for my LibGDX / Java based game project (because I used Slick2D earlier on, need more parameters so I made my own and then ported). The system is fairly standard as ...
1
vote
0answers
34 views
How can I connect multiple explorable regions into one large map? [closed]
I am planning a 2-D science fiction game involving spaceships. A major thing that I am having trouble figuring out is how to create a 2-d array of smaller maps that the player can explore.
My ...
1
vote
0answers
67 views
How do i implement a hit box system in a fighting game?
In a fighting game a move that you execute is basically just a series of hit boxes that are enabled and disabled at certain times. I want to know how do you create this hit box system. I have no idea ...
0
votes
0answers
22 views
HorizontalScrollView with multiple views in one “frame”
I have ImageButton, with TextView and ImagaView inside it. I have six of these. So I want to implement them into HorizontalScrollView. I remember I had one HorizontalScrollView with images some time ...
1
vote
1answer
34 views
Java- Trig based movement
I have been trying to create a smooth movement technique that would allow me to move in all directions, not just the 8 cardinal directions.
I have tried to use this doing trig, and while the ...
6
votes
1answer
83 views
Perspective-Correct Texture Mapping
I am working on a small rendering engine for a personal project and I am having issues with the texture mapping part of it.
It seems to work for some cases, but not for others. For example, when one ...
1
vote
1answer
31 views
Libgdx black rectangles problem
I'm working on a game for Android using Android Studio with LibGDX in Java.
I recently found a weird problem when closing and reopening the game. When I first open the game, it works fine. If I click ...
0
votes
1answer
26 views
Position of an object relative to another in a 2D plane
I have two objects, A and B, each of them has a set of coordinates (x,y). How do I understand where is A in relation to B's position?
If I where to just check each coordinates I could do it like ...
0
votes
3answers
62 views
LibGDX simple button with image
I want to make two image buttons (play, restart) in my main menu screen but I dont know how to do it. I tried this:
Texture playTexture = new Texture(...)
Image playImage = new Image(playTexture)
...
1
vote
1answer
60 views
How do you create a funky moving background?
I'm trying to create something similar to what you would see if you loaded a song in Windows Media Player (the cool abstract background that moves and produces various colors). I have no idea how this ...
4
votes
1answer
129 views
RAM usage unusually high, but CPU usage relatively low
I've created a relatively simple game using libgdx, but the RAM usage when I start up the game on my Android device is roughly 600-700 mb, but the CPU usage is only about ~0.05%. I've downloaded a ...
0
votes
0answers
13 views
Actions.fadeOut doesn't work when called on stage root
I'm trying to fade out my screen when a button is pressed, but the following code doesn't work:
public void switchScreen(final Game game, final Screen newScreen){
stage.getRoot().getColor().a ...
-3
votes
2answers
74 views
Is it possible to use Java as a scripting language in unity? [duplicate]
I wonder if its possible to use Java as a scripting language in unity to create a basic 2d game?
2
votes
1answer
69 views
Anti-Aliasing Problem
So, I was annoyed by how the HUD for my GameState was very pixel-ated and I wanted to change that through the use of anti-aliasing. However, it works with a small exception:
It adds all these lines ...
0
votes
0answers
25 views
How could I add XBox 360 Controller handling support to my game?
The title says it all. I'm making a 3D Open World game with OpenGL and LWJGL in Java, and I really need to move in several angles to fully feel inside the game. The problem is that I couldn't find any ...
0
votes
1answer
46 views
onHold input libGDX
I want to have onHold or onTouch input for my game. So as long as the user touches the screen something happens (a car moves) and when he stops touching the screen it stops. How do I do that?
I want ...
-1
votes
0answers
13 views
On touch input Libgdx [duplicate]
I want to have an on hold or on touch input for my game. So as long as the user touches the screen something happens (a car moves) and when he stops touching the screen it stops. How do I do that
0
votes
0answers
10 views
Libdgx and Overlap2D export settings for Android
So I have a problem when exporting assets from Overlap2D to Android Studio project location. When setting up libgdx I set the project to be for desktop and android and selected Overlap2D extension.
...
0
votes
1answer
77 views
How does one structure a Player GUI
I am using Java and the Slick2D library.
I've been testing around with ways to develop a Player Graphical User Interface (GUI) (to show armour, items picked up, weapons equipped, etc). The one ...
0
votes
0answers
5 views
LibGDX Child node is not following animation
So I'm trying to place a golf club as a child node of the hand of our "golfer", so it follows the animation the golfer has when the animation is invoked. However, once I hit "Check Swing" (the button ...
-1
votes
0answers
58 views
Implementing gesture detection in LibGdx
what I tried:
public class PlayState extends State implements GestureDetector.GestureListener {
private Protagonist bird;
private Texture bg;
GestureDetector gestureDetector;
...
0
votes
0answers
22 views
Making my game scalable? [duplicate]
I'm quite new to games development and just recently I've made my first Java platformer. I've been using Graphics2D to draw my spritesheets, but I've heard this method isn't very good in terms of ...
0
votes
1answer
66 views
Network interpolation wont work for local player
im currently developing a little duengon crawler. It should have lan multiplayer and it works great but i think im sending to much packets. Should i send packets over network, when a player moves in ...
-1
votes
0answers
20 views
how to move with update trajectoryPointCount [duplicate]
I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you!
enter code here
...
0
votes
0answers
62 views
Multiplayer through blocked Firewall Ports?
im currently trying to develop a little game. I thought it would be a great idea to implement coop multiplayer, only lan. So i took kryonet and created a server. On my home wlan it works great im able ...
0
votes
0answers
59 views
How to update projectile trajectory point?
I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you!
Here is my code:
...
1
vote
0answers
50 views
Libgdx stops all sounds when there are lots of sounds
I'm making a 2D game for Android using Android Studio with Libgdx in Java.
I have a class, called SoundPlayer, which holds an ArrayMap. The key is the name of the sound file and the value is the sound ...
0
votes
1answer
15 views
InputProcessor without stage
I have a GameScreen where I'd like to have a pause button. I've tried using an Image with a listener, but since my GameScreen isn't a stage, I can't use that in the inputProcessor. So my question is ...
0
votes
1answer
39 views
How to resize 2D Java game without “squeezing” it?
I am trying to make my second java game (2D) but i have run in a problem: The game will be in fullscreen, but how can i make it so it is scaled properly for each screen? While researching i found out ...
0
votes
0answers
27 views
TiledMap Safe Area for different screen resolutions
I'm creating a Tower Defense game using libGDX (w/ scene2d) and TiledMap.
I've been reading extensively about viewports and how I can better manage various screen sizes.
I want my Tiled Map to take ...
1
vote
2answers
54 views
OpenGL [LWJGL3] - Matrix4x4 not rotating correctly
I tried today to make my own matrix4f class because of that LWJGL 3 does not include a class for it. So I arrived at rotation and it does not seem to work. I tried using the old util from LWJGL 2 and ...
0
votes
1answer
44 views
Simplifying Object Factory
I'm making a game for Android using Libgdx with Android Studio in Java. In my game, I have a class called ObjectFactory which has a method createGameObject(int objectType) which receives an integer ...