New to game programming

Hi i am trying to create a 2d racing game and i am stuck with code to get my AI to go around the track could any1 help??

This is what i have currently got with a million errors
// Pathfollowing + seek behaviour
// To get acceleration which updates velocity

    FollowPath(Object source, Path path, float pathOffset); 
    {
    
    float pathPosition = path.getPathPosition(source.position);
    float targetPathPosition = pathPosition + pathOffset;
    Vector target = path.getPosition(targetPathPosition);
    
    acceleration = Seek(source.position, target);
    
    Vector velocity = new Vector();
    velocity.x += acceleration.x * timeDelta;
    velocity.y += acceleration.y * timeDelta;
    // veclocity.x += acceleration.x * timeDelta;
    // veclocity.y += acceleration.y * timeDelta;
    }

Any help would be greatly appreciated thanks

Have a look here. There’s loads of other useful stuff!

Thanks for the explanation Captain Awesome!

I also found this tutorial:
http://download.oracle.com/javase/tutorial/extra/fullscreen/index.html

Do you want to use high-performance graphics in the Java development environment? Have you always wanted to program a game, but your images wouldn’t move fast enough? Has your slide show program not worked properly because you had no control over the user’s display resolution? If you’ve been asking any of these questions, then the full-screen exclusive mode API, introduced in release 1.4, may be what you’re looking for.<<

This will be my next learning step in terms of handling graphics, though for the puzzle-game I am working on, the Timer-driven repaints of the JPanel are quite adequate.

Lol Mhogshaw you should probably create a new thread if you have a specific question, just throwing youre unrelated question in the middle of a conversation is hijacking :slight_smile:

And thanks so much philfrei and captain awesome. I think I know where Im headed and approximately how to get there. For now Ill be running through the various tutorials that I found/was given that use basic Java 2D and other internal libraries. Then I will slowly introduce myself to LWJGL and opengl in general with books or other resources. To me that seems like the logical path.