Hi C++ is my first language i am learning and i would like to start some project that involves a bit of AI and object avoidance but i have no idea where to start. My skill in C++ is pretty poor but i would like to start a small project so i have something to show my progress.

The things i would like to have in my project are

A window: that has a menu and a sidebar
the sidebar: showing objects to be placed on the window
Objects: one main object that will "walk" around and avoid or go to other objects.

this is my idea so far.
(but, i would like it to evolve in a project that involves a object which is able to learn from the user input and decides output on that. but thats for later)

can someone help me started? and is this doable with C++ alone.

I already know some win32 programming and the basics.

Recommended Answers

All 4 Replies

you need to know how you will tell your program where are your object, how they move, and what are they areas.
you should consider making a coordinate system on which your objects are going to move and you should make a function to move main object (or maybe use a keyboard to move it)...you can use some maths to calculate whether any objects are in contact, and if they do, than stop the collision by stopping one object or so.
im not good at this kind of stuff but there may already be a function that calculates whether two objects collide... good luck in your project

There are programming lanuguages written specifically for AI , e.g. LISP, C++ is not that suitable for AI, better try some easier topic for your project assignment.

Well my idea was to have some sort of simulation with objects for ex square moves away from circle, circle moves towards triangle etc..

Well i would start by learning how to make objects on the screen. Then make a Square class, Circle class, and Triangle class. And have functions that allow them to move, and get their position. Then make a loop that goes like:

// 1 = up, 2 = down, 3 = left, 4 = right
int MoveAway(int x1,int y1,int x2,int y2);
Circle c;
Square s;
Triangle t;
while(!quit)
{
    if(MoveAway(c.X,c.Y,s.X,s.Y) == 1)
        c.MoveUp();
    if(MoveAway(c.X,c.Y,s.X,s.Y) == 2)
        c.MoveDown();
    if(MoveAway(c.X,c.Y,s.X,s.Y) == 3)
        c.MoveLeft();
    if(MoveAway(c.X,c.Y,s.X,s.Y) == 4)
        c.MoveRight();
}

This would do nothing but just to give you an idea.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.