Results 1 to 3 of 3

Thread: Timer function

  1. #1
    luckycharm is offline Member
    Join Date
    Nov 2012
    Posts
    9
    Rep Power
    0

    Default Timer function

    I'm acctually trying to make a game where, a user will get a timed number of outputs using Thread.sleep(slp);. Then, after that user will have to press a key and enter it. At an exact time he should be able to do that to win the game. I just need the code where user i can put an if function when timer is equall to the timelimit player wins. Is it possible with timer function?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Timer function

    Consider giving us more background on your problem. Is this a Swing application? Can you give us more detail about your code and your current problem as it's not very clear to me?

  3. #3
    luckycharm is offline Member
    Join Date
    Nov 2012
    Posts
    9
    Rep Power
    0

    Default Re: Timer function

    Okay, if this were played in irl. The game would be like this, I will say something "catch my finger, catch it if u can!". While I'm singing i'll be tapping my finger up and down against my friends palm and he is suppose to catch my finger at the end of the phrase.

    So, if I were to make it into a java game I'll be saying a timed phrase, and the user is supposed to enter an input exactly at the end of the phrase ( lets say after 10 seconds).

Similar Threads

  1. Recursive function to iteractive function
    By mikeZet in forum New To Java
    Replies: 0
    Last Post: 03-13-2012, 02:42 AM
  2. Calling function in Javascript- from other function
    By jdigger in forum New To Java
    Replies: 1
    Last Post: 02-27-2011, 10:00 PM
  3. Stopping a Timer from Inside the timer
    By krishnan in forum Java Applets
    Replies: 2
    Last Post: 10-05-2010, 12:15 AM
  4. Replies: 3
    Last Post: 12-04-2009, 04:08 PM
  5. Replies: 0
    Last Post: 04-04-2008, 03:46 PM

Posting Permissions

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