Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Dec 2003
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    first java game question

    hello,

    i am making my first java game(pong) and i am about 1/2 there.

    i am now just trying to get a ball to move around with the keyboard in preperation for the paddles. everything works fine exept for this:

    public boolean keyDown(Event e,int key){
    if(key==Event.LEFT) x_speed=1;
    return true;
    }

    x_speed is the variable that moves the ball around horazontally.

    why doesnt this work? the whole program is in the attachment and what it does is make a ball bounce around and when you press the left button, it should stop...

    i hope im making sense...

    Di
    Attached Files Attached Files


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •