Results 1 to 4 of 4
  1. #1
    bamibal is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default need help with game

    I need help with a game i make for school.
    My idea for the game is a reaction game;
    first 2 buttons or some sort of circle whatever, When one button dissapear, you have to click on the other button as fast as possible.
    The problem is, i have absolutely no idea how i must make the timer who counts the time between the button that dissapear, and when you click the button
    Sorry for my bad english. :P

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,587
    Rep Power
    25

    Default Re: need help with game

    timer who counts the time between the button that dissapear, and when you click the button
    You could use a method in the System class that returns the current time. Capture the time of the first event and then the time of the second event and take the difference.

  3. #3
    bamibal is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default Re: need help with game

    well can you give a example of that?
    I am a beginner with java, and i think the teacher doesn't get it himself either ;p

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,587
    Rep Power
    25

    Default Re: need help with game

    long startTime = <GET THE TIME>;
    ... do something that takes time
    long duration = <GET THE TIME> - startTime;

Similar Threads

  1. I need help with my game
    By chara in forum AWT / Swing
    Replies: 15
    Last Post: 09-18-2011, 04:48 PM
  2. Replies: 1
    Last Post: 06-02-2011, 10:29 AM
  3. Replies: 2
    Last Post: 08-05-2010, 05:49 AM
  4. game code for any game
    By deathnote202 in forum Java Gaming
    Replies: 4
    Last Post: 06-10-2010, 09:06 AM
  5. 2D strategy game or 2D war game
    By led1433 in forum Java 2D
    Replies: 5
    Last Post: 02-10-2009, 07:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •