• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

need help with my breakout game

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys im new here and i need little help with my "breakout" game


i need a code to move the paddle "easy code" with arrow keys "left and right"





this is my code!!













 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you press the key, the code changes the location of whatever you want moved, then calls [container].repaint(),
so, the whatever is drawn at the new location.

if you want the whatever to keep moving whilst the key is pressed, you start a timer to do the above, keyReleased stops the timer.

I'd post a bit more detail, but as you've posted this elsewhere, I won't.

also, you may run into problems by mixing awt components with swing components
 
Semthan Waleed
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i don't know but its still not working


 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> i don't know but its still not working

you've had a bunch of replies on your other posts (are you up to 10 forums yet?),
so I'm not going to have their time wasted by posting the simple solution.
 
reply
    Bookmark Topic Watch Topic
  • New Topic