• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do you move a object and make the object shot laser?

 
jin Otanashi
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can a keyevent in java make the space ship and the laser too ?
 
Campbell Ritchie
Marshal
Posts: 52581
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, of course it can. You have a move method and s fireLaser method; all you have to do is call both from inside the listener.
 
jin Otanashi
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Yes, of course it can. You have a move method and s fireLaser method; all you have to do is call both from inside the listener.

Ok thank
do the asteroid use the same keyevents or just a recursive but asteroid have different size and move random location i wonder how i can do that ?
 
Darryl Burke
Bartender
Posts: 5155
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing, AWT, SWT, JavaFX or something else?
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!