Questions tagged [java]
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.
3,439 questions
96
votes
12
answers
16k
views
What data-type should I use for in-game currency?
In a simple business simulation game (built in Java + Slick2D), should a player's current amount of money be stored as a float or an ...
65
votes
8
answers
85k
views
Is Java viable for serious game development? [closed]
I have scoured the internet, but there are not very many resources for Java game development, not nearly as many as C++. In fact, most engines are written in C++. I tried to play a game made with ...
41
votes
5
answers
10k
views
How can I give the illusion of height to a ball in 2D?
In 2D top down soccer games, sometimes a ball is given the illusion of being in the air, like below:
How can I achieve this?
37
votes
6
answers
25k
views
What is a good file format for saving game data? [closed]
I need to save some custom game data. Map, player, etc.
All of them will have "sub objects". For example, a map and map will have an "array" of tiles. ie, hierarchical data. Hopefully nothing ...
35
votes
7
answers
20k
views
How can I improve rendering speeds of a Voxel/Minecraft type game?
I'm writing my own clone of Minecraft (also written in Java). It works great right now. With a viewing distance of 40 meters I can easily hit 60 FPS on my MacBook Pro 8,1. (Intel i5 + Intel HD ...
23
votes
3
answers
10k
views
Efficiently pathfinding many flocking enemies around obstacles
I'm working on trying to improve the pathfinding for my game's enemies. Right now, they basically just constantly move towards the player's exact position by calculating the angle between themselves ...
23
votes
4
answers
1k
views
How to implement a never-rebooting test world?
Am looking for ideas on how to do the following: I want to write a simple "world" in Java. One which I could start and then add new objects later at a later date to simulate/observe different ...
21
votes
3
answers
15k
views
Polling vs event driven input
I'm developing a game using polling for the input method. However, now that I'm delving deeper into the game menus and other UI components, I'm finding that I'd probably like to have event driven ...
21
votes
2
answers
9k
views
How can I define items in my RPG like Java game?
I am casually working on an RPG type game in Java but I am having trouble figuring out how I can have items that can do many different things without creating a different class for every item.
As an ...
20
votes
8
answers
14k
views
Imperfect pong AI
So I'm starting to learn Java and some OpenGL while using the LWJGL. To start off easy, I'm writing a clone of the Atari Pong. I got set up correctly the game screen, collision detection, and all the ...
20
votes
4
answers
8k
views
Is there any harm in having the main game loop run uncontrolled?
I was wondering if there is any possible harm when my game loop runs as fast as the system allows?
I currently have a loop, that, by measuring passed time in nanoseconds, runs the game logic and ...
18
votes
2
answers
11k
views
LibGDX - Check if currently on Android/Desktop
I'm using LibGDX and flixel-android to build a Desktop/Android game. It feels like there should be a way of checking to see if you're currently being run on an Android device, the Desktop, and so on, ...
17
votes
3
answers
5k
views
How do I efficiently code both the client and server at the same time?
I'm coding my game using a client-server model. When playing on singleplayer, the game starts a local server, and interacts with it just like a remote server (multiplayer). I have done this to avoid ...
17
votes
14
answers
2k
views
Advice for a first year CS major [closed]
I'm coming to the end of my first year of CS which has been primarily a Java based course. I'd like to get my feet wet with some game development but I'm not sure where to start.
Some people have ...
16
votes
10
answers
6k
views
Random noise based on seed
I am currently working on a program that should generate random noise on a screen based on the 'coordinates' of a pixel. The coordinates should have the same color every time you restart the program. ...