• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jump key for applet game

 
Mark Lockery
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me with a jump key for a simple applet game.

I tried using a thread sleep comand between the increase in y value, and the decrease, but it just waited the designated time and then placed the character at the final destination.

Any suggestions would be helpful, but i am reasonably new to the whole java thing. I managed to make one in an application by putting the y value increase under "keypressed" and the y value decrease under "keyrelease", which obviously isnt the best way but it worked as well as i could figure out.

I don't think this is an option as the keycodes im using in the applet are different and there is not keypressed and keyreleased.
 
Shashank Agarwal
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if your using the sleep and change in y axis co-ordinate in tandum, i think its the best way to get around. Do not forget to use double buffering. Keep the sleep time max for 90 milli sec. so that users will feel as though the motion is dynamic. (The human eye cannot see two images seperately if not held for more than 1/10th of a second).

All the best.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic