Hey all! I'm trying to make an enemy move to a player using line of sight. The problem I have is the enemy speed is different on different screen resolutions.
I'm using Move At Angle when the enemy has LOS to the player, it uses pixels to set the speed. I tried doing something like (WindowWidth / WindowHeight) * 5 to change the speed based on the resolution but that didn't help (pretty sure my equation is flawed for this purpose but I'm a doof and can't think of a proper one). The player uses simple 8-direction WASD movement.
I'm using letterbox scaling to fit the screen. The game itself is a rogue-like that auto generates the map and letterbox scaling is the only option because of how the code works so changing it isn't much of an option at this point. Plus I really want the game to work on any resolution.
I tried enemy movement with pathfinding too but it doesn't quite work. The enemy will go to the end of the path, even if it has lost LOS to the player. This creates a situation where the enemy is chasing the player much more than expected because the enemy is walking back into the LOS by itself if the player has stopped moving.
I put together a stripped down capx that illustrates all this, sans auto map generation
http://wikisend.com/download/315374/los-example.capx[/code:38sfbtdf]
How can I make the enemy speed constant across any screen resolution but stop him if he loses line of sight of the player? Any help is greatly appreciated!!