Yay I got it working
Now I just need to make an automated version that can drive itself, detect walls (boolean) and automatically shoot at other tanks!
I know I need a while loop for this but is there anything else needed?
I'm re-writing this
Code:
public void keyPressed(KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_RIGHT)
{
this.turnRight();
}
else if (e.getKeyCode() == KeyEvent.VK_LEFT)
{
this.turnLeft();
}
else if (e.getKeyCode() == KeyEvent.VK_DOWN)
{
this.reverseGear();
this.accelerate();
}
else if
(e.getKeyCode() == KeyEvent.VK_UP)
{
this.forwardGear();
this.accelerate();
}
if (e.getKeyCode() == KeyEvent.VK_ALT)
{
this.fire();
}
Any advice would be appreciated
Social Networking Bookmarks