i made a game that has a player and an AI player.... i use a timer for the ai player to make its moves and the keydown for the human player....

when the player presses a key(e.g A to go left) then the ai player stops moving or it moves slowly!

any ideas how to solve this problem?

Chances are your timers are set incorrectly.

You should wait for user input or have a count down then if user input = true subtract the remaining time out.

This will force the AI to make a move/decision.

Also be sure to refresh the screen after each move so that it looks smooth.

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.