My game is like cars are coming from above and player has to dodge it by moving left or right,
(x,y)
is players postion(enemy_startx,enemy_starty)
is enemys position
other variables are obvious
#These are also the crash conditions for the game.
if y < enemy_starty+enemy_height:
if x > enemy_startx and x < enemy_startx + enemy_width or x+(car_width+5) > enemy_startx and x + (car_width+5) < enemy_startx+enemy_width:
crash()