This is the enemy movement:
if playerX > enemyX:
enemyX += 0.5
elif playerX < enemyX:
enemyX -= 0.5
elif playerY > enemyY:
enemyY += 0.5
elif playerY < enemyY:
enemyY -= 0.5
Both the position of the player and the enemy are predetermined. The enemy starts at (370,50) and the player at (370, 480). The player can be moved using the arrow keys. If the enemy collides with the player the game ends. That part works just fine. The problem is that once I change enemyY or enemyX to below 0.5 the enemyY won't change anymore. But 0.5 is too fast, the player barely has any time to evade the enemy. I was wondering if I can write this differently so that the issue won't occur anymore? I don't know how to fix this and I have been searching for a solution for a while. It would be great if somebody could kindly help me out here.