So I've started to introduce ShadowDarke's PP library into a project of mine and I was wondering how I would go about making sure that the client faces their target within a certain range.
eg. You enter game, double click another player (target) and once you're within x tiles you face them, like a Mexican stand off kinda thing. Any ideas?
Is there any reason inparticular that you define the distance instead of using a num in the Move proc or is that just something you do? :)
|
I don't know what your preferences are, so I just want to make it clear that 5 was an arbitrary choice.
I do tend to use preprocessor definitions, rather than embed the behavior directly. It makes the game quite a bit easier to adjust for changes down the road. |
Okay, I was wondering if there was some advantage to definitions as opposed to embedding in this situation. Thanks. :)
|
Would there be a way to make it so that the player would face their target with pixel precision? As in, you face your opponent even at an angle?
Sorry, I've just finished my whole implementation and it's odd to see projectiles firing with such precision when you're aiming only roughly in their direction. Thanks in advance. :) |
Yeah, but it's going to require either a non-projected perspective for your whole game, or generating more than 8 directional states, which can be time-consuming and costly.
Either way, it's not really a question. |
Given a little bit more work, this system can be expanded to be quite sophisticated.