Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (511)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  GAGETimer 1.1 released!  (Read 2119 times)
0 Members and 1 Guest are viewing this topic.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Posted 2004-02-12 15:24:58 »

GAGETimer 1.1 has been released! The primary feature added was support for the 1.5 System.nanoTime() call. GAGETimer will check the VM version and use the nanotimer if it's 1.5 or higher. If that check fails, it will attempt to fall back on the windows DLL, and if that check fails (because the DLL is missing or you're not using Windows) it will finally fall back on System.currentTimeMillis().

Even more interesting is the addition of a new class called "DurationTimer". DurationTimer is a precise countdown timer that is useful for time bounded game events. Some interesting uses:

- Kill the player if they don't finish a level in time. (ala Mario Bros.)!
- Temporary power-ups like Quad damage!
- Fuses for bombs!
- Construction of units!
- Just about anything else that needs to happen within a set amount of time.

Methods are included for developing progress bars, showing seconds and percentages, and pausing the timer (important for when the user pauses the game or some event (like lack of money) stops the countdown).

So, what do you think?

URL: http://java.dnsalias.com

Java Game Console Project
Last Journal Entry: 12/17/04
Offline SpuTTer

Senior Duke


Medals: 1
Exp: 14 years


Lazy Middle Class Intellectual


« Reply #1 - Posted 2004-02-12 16:06:47 »

Excellent. Sounds like great stuff. I'll check it out later.

Sacramento Volleyball
"Whitty phrase goes here."
Offline Jeff

JGO Coder




Got any cats?


« Reply #2 - Posted 2004-02-13 02:30:18 »

You left out my response which is....

"And why do I use this rather then the nanosecond timer thats now in 1.5?"

I'm really genuinely curious if there is a compelling reason.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2004-02-13 09:17:18 »

It abstracts away the requirement of JDK1.5. You can use the GAGE API on any VM from 1.1 and upwards and it does the best it can.

Cas Smiley

Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #4 - Posted 2004-02-13 12:05:21 »

Quote
You left out my response which is....

"And why do I use this rather then the nanosecond timer thats now in 1.5?"

I'm really genuinely curious if there is a compelling reason.


Like Cas said, it's cross version *and* it contains support for the nanotimer. It also takes care of a lot of the details for you, such as a highly efficient sleep loop. And the addition of the DurationTimer provides an easy way to handle timed events in game. It even supports the user pausing the game without any special code. (That's one of those things that often gets forgotten and is very difficult to add later.)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline Herkules

Senior Duke




Friendly fire isn't friendly!


« Reply #5 - Posted 2004-02-16 07:04:18 »

I'm missing the point: "I use system stuff instead of another third-party jar/dll"

The FlyingGuns-utilities define a timing framework as well. Checking e.g. for Java3Ds hires-timer availibility and fallback to currentTimeMillis() is just 2 lines of code or so.
And there's a command-queue that allows to submit time-related commands. Also very easy things!

And for you need to define these things to fit your special needs anyway, you can easily embedd the neccesary timing features as well w/o having to interface a third-party lib.

So I feel an external timing lib makes sense only if


  • Hires timing is really required
  • Java3D is not available
  • 1.5 is not available


For all three points still are LIKELY to coincide, it is GOOD to have the external timer available. But it should be as SMALL as possible in interface and jar-size.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (42 views)
2014-10-16 15:22:06

Norakomi (32 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (85 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!