0 Favourites

# Applying perspective on distance calculations.

• 1 posts
• Hi. I'm trying to do a game that uses a beat'em'up-style perspective. The tech demo I've been working on is here:

I'm implementing enemies right now, but I have a problem that's nagging me since I've started working in the game and that I would really like to solve: I need to know what's the distance between an object and my player while accounting for the perspective. For example, I'll set an enemy to "prowl" (i.e: move in circles) around the player at a certain distance. However, the enemy will do so at (let's say 200) pixels always, but what I want is for it to prowl at such a distance that while its absolute X and Y might be different from 200, it's really at 200 "tile-pixels" from the player. I hope I'm explaining myself here. I've been looking around, but I haven't found a way to do so without tons of math and projections, and I would like to know if someone has a quick or easy way for me to achieve this with Construct. Thanks in advance!