I'm unable to access a member from an object properly

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 559 Views - Last Post: 06 December 2012 - 03:26 PM Rate Topic: -----

#16 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8315
  • View blog
  • Posts: 31,836
  • Joined: 06-March 08

Re: I'm unable to access a member from an object properly

Posted 06 December 2012 - 08:40 AM

What does the method pause() do ?
Was This Post Helpful? 0
  • +
  • -

#17 Takwas  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 33
  • Joined: 05-September 12

Re: I'm unable to access a member from an object properly

Posted 06 December 2012 - 10:53 AM

View Postpbl, on 06 December 2012 - 04:40 PM, said:

What does the method pause() do ?



From this page:

http://jtf.acm.org/j...dent/index.html

it says:

public void pause (double milliseconds)

Delays the calling thread for the specified
time, which is expressed in milliseconds.
Unlike Thread.sleep, this method never
throws an exception.

Usage: program.pause(milliseconds);

Parameter: milliseconds The sleep time in milliseconds
Was This Post Helpful? 0
  • +
  • -

#18 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8315
  • View blog
  • Posts: 31,836
  • Joined: 06-March 08

Re: I'm unable to access a member from an object properly

Posted 06 December 2012 - 11:15 AM

so as your delay can go to 0.05 and you pause(delay * 100) it means that you may sleep 5 millisecond which is completly but really completly useless

A CRT is refresh 60 times a second (in North America, 50 times inm Europe) so every 16.66666 milliseconds.
so with a delay of 0.05 you have the time to play 3 game turns before the CRT is actually refreshed. That is why your game seems slow, it is just that you just don't see it pass by and you see only one turn out of 3.

Your shortest delay should be 0.18 which means 0.18 * 100 18 millisecond which let your computer the time to play a turn and refresh the CRT.

Happy coding
Was This Post Helpful? 1
  • +
  • -

#19 Takwas  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 33
  • Joined: 05-September 12

Re: I'm unable to access a member from an object properly

Posted 06 December 2012 - 03:26 PM

View Postpbl, on 06 December 2012 - 07:15 PM, said:

so as your delay can go to 0.05 and you pause(delay * 100) it means that you may sleep 5 millisecond which is completly but really completly useless

A CRT is refresh 60 times a second (in North America, 50 times inm Europe) so every 16.66666 milliseconds.
so with a delay of 0.05 you have the time to play 3 game turns before the CRT is actually refreshed. That is why your game seems slow, it is just that you just don't see it pass by and you see only one turn out of 3.

Your shortest delay should be 0.18 which means 0.18 * 100 18 millisecond which let your computer the time to play a turn and refresh the CRT.

Happy coding



thanks ;)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2