I built a simple HTML game. In this game the goal is to click when the blue ball is above the red ball. If you hit, you get 1 point, if you miss, you lose 1 point. With each hit, the blue ball moves faster. You can test the game here.
Without using machine learning, I would easily solve this problem by just clicking when the X, Y of the blue ball was on the X, Y of the red ball. Regardless of the time, knowing the positions of the 2 elements I could solve the problem of the game.
However, if I wanted to create an AI to solve this problem, could I? How would it be? I'd really like to see the AI randomly wandering until it's perfect.
My way to solve the problem
I click many times and watch score. If score down, add to bad_positions. If actual position in bad_positions, not click. At first he misses many times, then starts to hit eternally. This is machine learning? Deep learning? Just a bot?
var bad_positions = [];
function train(){
var pos = $ball.offset().left;
var last_score = score;
if (!bad_positions.includes(pos)) {
$('#hit').click();
if (score < last_score){
bad_positions.push(pos)
}
}
}