I am trying to write a racing game but i need some winning conditions. Im not sure where to start, any pointers would help. Im using Visual C++

I am trying to write a racing game but i need some winning conditions. Im not sure where to start, any pointers would help. Im using Visual C++

Start by explaining what you mean by "winning conditions" and what exactly the program is supposed to do.

the code is a racing game that is controlled by key inputs, i am trying to get accleration aswel if anyone knows anything about that. The code was a pong game that was hacked into a racing game which is a split screen and the user controls the background to move a horse around a fair type thing. Im not sure what i can do to make it seem like a player(there are two) wins and therefore makes the game quit.
I am hoping for the horses to race to find the tent with the red flag on it, then display player "1" or "2" wins depending on who makes it there first. then after 3 seconds the game will quit. Is it possible for C++ to find a colour on the screen or do i need to think or something different?

the code is a racing game that is controlled by key inputs, i am trying to get accleration aswel if anyone knows anything about that. The code was a pong game that was hacked into a racing game which is a split screen and the user controls the background to move a horse around a fair type thing. Im not sure what i can do to make it seem like a player(there are two) wins and therefore makes the game quit.
I am hoping for the horses to race to find the tent with the red flag on it, then display player "1" or "2" wins depending on who makes it there first. then after 3 seconds the game will quit. Is it possible for C++ to find a colour on the screen or do i need to think or something different?

So you have the source code for this game and/or the original game or you don't? If all you have is the executable for the game, I guess one way would be take screenshots, then parse the JPEG image for certain color values and figure out if they occur and where. That would be a lot of work. I'm sure it's doable in C++ or C. Just about everything is.

If you have the game source code, then I guess it's a matter of digging into it and finding what paints the color onto the screen and doing whatever with that information.

If this is some type of video game and you don't have the source code and want to make a bot or whatever, anything's possible, but it certainly is a major task.

You need to:

  1. Figure out exactly what you have.
  2. Figure out exactly what you are trying to do.
  3. Decide what your skill level is.

I'm not entirely sure what you're going for. If you don't have C++ source code with an actual precise question, you're probably in the wrong forum. If you have source code and you want to change the game to do something else, you may be in the right forum.

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.