Hi all.
I’ve created a turret that follows the closest enemy within a specified range but i’m having a few issues. The first one seems that the sprite gets distorted when it rotates, as if then batch is trying to make it look better? Or something. Wondering if anyone has come across this (I’m using pixel art).
The other issue I have is that I want the tower to rotate at a set speed, at the moment it simply follows the enemy at whatever speed it is going. I thought it might be cool if different turrets went at different speeds
Also, at the moment, if no enemy is selected after the turret has been following an enemy, it will snap back to it’s original position which looks bad. I was thinking that I could use something like this to solve it:
if(enemyToTarget != null){
// Rotate to face enemy
}else{
if(turret.getAngle != 180){
turret.setRotation(angle--);
}
}
Obviously i’d have to check if the tower is facing up/down or what angle to actually face at but I feel this should work