Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JPanel image movement problem

807606May 25 2007 — edited May 26 2007
Hi.

I had an end year project in my Computer Science class (highschool) and me and my partner chose to make a birds eye view game where you would move up, down, left, and right and attack enemies. The controls and movement were supposed to have been reminiscent of Legend of Zelda 1 on the nes.

Our problem is how the character is moving so far. When you press any of the arrow keys, he starts moving until you let go. But instead of moving smoothly, he starts and stops abruptly and quickly and then moves normally.

I used a buffered image object for the character and had him drawn on the JPanel, and on keyPress() it would increase/decrease the y or x accodringly. The only problem was the movement.

Any suggestions?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 23 2007
Added on May 25 2007
11 comments
478 views