This post originated from an RSS feed registered with Java Buzz
by Fred Grott.
Original Post: Decoupling GameLogic from Repainting-J2ME
Feed Title: ShareMe Technologies-The Mobile Future
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: A Weblog about Java programming and digital convergence on mobile devices in such areas as P2P and collaborative technology. Old Archive .
Although this helpfull thread is for J2ME, its also applicable to J2SE
games as well if you are working on a game in that area of java. The
reason why you want to decouple repainting code from gameLogic code in
J2ME is to automatically adjust to particular handsets.
For
example, Siemens handsets have a slower FPS rate than Nokia so you want to
adjust FPS downward. The way to do this is to decouple the repaint and
game logic code from each other. This
thread from J2ME.org shows how to accomplish this goal, thanks Marty! It
just so happens that I was thinking of how to refactor my gameLogic code
to deal with these issues, so it came in at a real good time.
For
J2SE game developers you would want to use this code because they you
could adjust game FPS for what graphic cards are avaible, graphics drivers
avaible, desktop cpu speed, and etc. Plus decoupling gameLogic code from
repainting code avoids the issue of repaint not returning until finished.