Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualDemion

Posted 16 March 2014 - 06:10 AM

 

Your GetTime() method looks suspicious to me.

 

GetTime() multiplies counter x 1 000 000 before division and that gives perfect microsecond accuracy ( frequency = 1 second = 1 000 000 microseconds). Anyway please also take a look at second source code which actually makes drawing without any time involved. Its not time releated problem at all.

 

 

for example, if you do push-up, release-up, push-up, push-right, you have added to up-velocity twice and right-velocity once and that will have the effect of not looking diagonal until you press down once.

 

Not true. Press-Up velocityY -=4, Release-Up velocityY +=4 (resulting velocityY == 0), Press-Up velocityY -=4, Press-Right velocityX += 4 (resulting velocityY == -4, velocityX == 4) etc. Please notice that on key release I call ProcessInput with negative velocity value (on key press positive value accordingly).
 
It would be great if you compile (it has no dependencies) and take a look it works perfectly fine except multiple key "simultaneous" press / release not always detected correctly becouse of delay between message (they are detected one by one, first one key and after slight delay second key which leads to unwanted results).

#3Demion

Posted 16 March 2014 - 06:08 AM

 

Your GetTime() method looks suspicious to me.

 

GetTime() multiplies counter x 1 000 000 before division and that gives perfect microsecond accuracy ( frequency = 1 second = 1 000 000 microseconds). Anyway please also take a look at second source code which actually makes drawing without any time involved. Its not time releated problem at all.

 

 

for example, if you do push-up, release-up, push-up, push-right, you have added to up-velocity twice and right-velocity once and that will have the effect of not looking diagonal until you press down once.

 

Not true. Press-Up velocityY -=4, Release-Up velocityY +=4 (resulting velocityY == 0), Press-Right velocityX += 4 etc. Please notice that on key release I call ProcessInput with negative velocity value (on key press positive value accordingly).
 
It would be great if you compile (it has no dependencies) and take a look it works perfectly fine except multiple key "simultaneous" press / release not always detected correctly becouse of delay between message (they are detected one by one, first one key and after slight delay second key which leads to unwanted results).

#2Demion

Posted 16 March 2014 - 06:06 AM

 

Your GetTime() method looks suspicious to me.

 

GetTime() multiplies counter x 1 000 000 before division and that gives perfect microsecond accuracy ( frequency = 1 second = 1 000 000 microseconds). Anyway please also take a look at second source code which actually makes drawing without any time involved. Its not time releated problem at all.

 

 

for example, if you do push-up, release-up, push-up, push-right, you have added to up-velocity twice and right-velocity once and that will have the effect of not looking diagonal until you press down once.

 

Not true. Press-Up velocityY -=4, Release-Up velocityY +=4 (resulting velocityY == 0), Press-Right velocityX += 4 etc. Please notice that on key release I call ProcessInput with negative velocity value (on key press positive value accordingly).
 
It would be great if you compile (it has no dependencies) and take a look it works perfectly fine except multiple key "simultaneous" press / release not always detected correctly becouse of delay between message.

#1Demion

Posted 16 March 2014 - 06:05 AM

 

Your GetTime() method looks suspicious to me.

 

GetTime() multiplies counter x1000000 before division and that gives perfect microsecond accuracy. Anyway please also take a look at second source code which actually makes drawing without any time involved. Its not time releated problem at all.

 

 

for example, if you do push-up, release-up, push-up, push-right, you have added to up-velocity twice and right-velocity once and that will have the effect of not looking diagonal until you press down once.

 

Not true. Press-Up velocityY -=4, Release-Up velocityY +=4 (resulting velocityY == 0), Press-Right velocityX += 4 etc. Please notice that on key release I call ProcessInput with negative velocity value (on key press positive value accordingly).
 
It would be great if you compile (it has no dependencies) and take a look it works perfectly fine except multiple key "simultaneous" press / release not always detected correctly becouse of delay between message.

PARTNERS