Tagged Questions
1
vote
6answers
281 views
Avoiding constant IF checks for loops
As an example, I have 3 different loops that are executed in certain conditions.
I want to know if there's any way short of something like this:
if(day)
x++;
else if(night)
y++;
else
z++;
...
1
vote
0answers
53 views
How to implement a multi-platform Java 2D game engine's graphics?
I'm not sure whether this question should be posted here. I'm trying to make a basic generic game engine in Java. Here's what I have so far.
public abstract class Device {
public abstract void ...
1
vote
2answers
281 views
Why are my game ticks longer than expected?
I was working on my game, adding stuff to it, when I noticed my ticks were in the low 50's when I had set it to do a constant 60. This is my run method.
public void run() {
init();
long ...
5
votes
2answers
290 views
Java 2D game programming: Different approaches to make a game loop
I am new to Java game programming, but the more I read the more I'm confused, because I've seen several different approaches to make a game loop:
1. The standard approach, that uses the Timer class ...
3
votes
1answer
194 views
The most efficient and accurate game loop?
Obviously for a game to work you need a game loop... Normally, my game loop would consist of something like this:
while(running){
update();
render();
Thread.sleep(10);
}
This seemed to ...
0
votes
0answers
76 views
How to monitor the object position while it moves from one place to another?
In my game two objects rotate in opposite directions and at one particular
place, the two objects meet. In that place I want to track the x and y degrees.
If this is possible please share your ideas.
...
4
votes
2answers
561 views
Server side game loop
Many java games use thread.sleep() to controll fps. Since the server does not display graphics, should the server game loop keep running just calculating delta time? Like this example:
long ...
1
vote
1answer
104 views
Help to organize game cycle in Java
I'm pretty new here (as though to a game development).
So here's my question.
I'm trying to organize a really simple game cycle in my public static main() as follows:
Scanner sc = new ...
0
votes
1answer
206 views
How to make this game loop deterministic
I am using the following game loop for my pacman clone:
long prevTime = System.currentTimeMillis();
while (running) {
long curTime = System.currentTimeMillis();
float ...
1
vote
2answers
652 views
Why does my game loop speed vary on different platforms with the same hardware?
I've got a serious issue with my game loop. This loop varies in time with the platform and with the same hardware. This is a list of FPS achieved:
- Windows ======= 140 to 150
- Linux ...
0
votes
2answers
159 views
Negative timeout value in Variable Timestep loop
I was working on my game loop and I came across an odd problem. The loop was working fine, my states could render, received updates, etc. I then proceeded to create my Input system, which, also works. ...
0
votes
0answers
451 views
Best practices in Game architechture design [closed]
I have to create a game using Java. It is a simple game with a mix of rules from Texas Hold'em and Scrabble. The purpose of this project is to cover all software engineering practices. I have some ...
0
votes
1answer
405 views
Java2D Game Flickering
I'm in the process of trying to get familiar with making games in Java, using the Swing library.
Coding my Snake game however, I've got to a point where the game is flickering/ghosting and I haven't ...
0
votes
1answer
226 views
Rendering Loop Problem (Java)
I'm not new to programming, but I am relatively new to game programming. I am trying to create a version of Breakout, as a good basic game to get myself introduced to 2d game programming.
I currently ...
-2
votes
1answer
151 views
Issues with networking in my Java game, Client crashes when I try and read from the server input
A buddy and I have been programming a code game over the last 2 weeks, it is intended to be a multiplayer game with the ability to have 2 players play against each other.
I am running into an issue ...