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
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