Skip to main content
this bit was irrelevant and thus confusing
Source Link
jhocking
  • 15.8k
  • 2
  • 44
  • 59

I am new to Java game programming, but the more I read the more I'm confused, because there are so many approaches to reach the same goal: Some draw on a JFrame, others on a Canvas or a JPanel inside a JFrame.

There are alsoI've seen several different approaches to make a game loop:

  1. The standard approach, that uses the Timer class (seems to be less precise).
  2. The more precise approach that uses System.nanoTime.
  3. A simple approach that uses scheduleAtFixedRate.

Which one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.

I am new to Java game programming, but the more I read the more I'm confused, because there are so many approaches to reach the same goal: Some draw on a JFrame, others on a Canvas or a JPanel inside a JFrame.

There are also different approaches to make a game loop:

  1. The standard approach, that uses the Timer class (seems to be less precise).
  2. The more precise approach that uses System.nanoTime.
  3. A simple approach that uses scheduleAtFixedRate.

Which one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.

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 (seems to be less precise).
  2. The more precise approach that uses System.nanoTime.
  3. A simple approach that uses scheduleAtFixedRate.

Which one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.

Tweeted twitter.com/#!/StackGameDev/status/323432518823055361
Fixed grammar
Source Link

I am new to Java game programming, but the more I read the more I'm confused, because there are so many approaches to reach the same goal: Some draw on a JFrame, others on a Canvas or a JPanel inside a JFrame.

There are also different approaches to make a game loop:

  1. The standard approach, that uses the Timer class (seems to be less precise).
  2. The more precise approach that uses System.nanoTime.
  3. A simple approach that uses scheduleAtFixedRate.

Which is one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.

I am new to Java game programming, but the more I read the more I'm confused, because there are so many approaches to reach the same goal: Some draw on a JFrame, others on a Canvas or a JPanel inside a JFrame.

There are also different approaches to make a game loop:

  1. The standard approach, that uses the Timer class (seems to be less precise).
  2. The more precise approach that uses System.nanoTime.
  3. A simple approach that uses scheduleAtFixedRate.

Which is one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.

I am new to Java game programming, but the more I read the more I'm confused, because there are so many approaches to reach the same goal: Some draw on a JFrame, others on a Canvas or a JPanel inside a JFrame.

There are also different approaches to make a game loop:

  1. The standard approach, that uses the Timer class (seems to be less precise).
  2. The more precise approach that uses System.nanoTime.
  3. A simple approach that uses scheduleAtFixedRate.

Which one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.

Source Link

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 there are so many approaches to reach the same goal: Some draw on a JFrame, others on a Canvas or a JPanel inside a JFrame.

There are also different approaches to make a game loop:

  1. The standard approach, that uses the Timer class (seems to be less precise).
  2. The more precise approach that uses System.nanoTime.
  3. A simple approach that uses scheduleAtFixedRate.

Which is one should generally be preferred and where are the advantages/disadvantages of each approach? Thanks in advance for any info.