This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can someone please fix my code?

 
Aaron white
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey. well me and my freind have been working on this lately and we were both new to applets. but i was hopeing someone could help us fix it.

we need the blue triangle to move across the horizantal axis under the command of the arrow keys

thanks for any help!


[ UD: added linebreaks to preserve layout ]
[ May 15, 2008: Message edited by: Ulf Dittmer ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

That's a lot of code to read through and try to understand. What does it do now, and how does it deviate from the desired behavior?
 
Aaron white
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well at the moment it wont move at all.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some things to look into:

Are the keyUp and keyDown methods being called when they should?

Where are the values 1005, 1006 and 1007 coming from? Those look wrong. Have a look at KeyEvent.VK_LEFT and friends.

The fields "up", "left" and "right" are not used as far as I can see.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic