N
Niche Quiche
Guest
In some games there is an aiming system consisting of a dotted line and an icon where a given projectile would land (most common in tank or golf games). The dotted line is my focus here, though. When aiming a projectile, I want to have a set number of dots in the line that compact as the shot's range gets shorter, and space out as the range gets longer. For example:
Player-.-.-.-.-.-.-.-.-.- X
Player- . - . - . - . - . - . - . - . - . - . X
Both lines have 10 dashes (don't mind the dots), but one goes farther than the other. The dashes are all equally spaced out regardless of the distance or angle, and there is a set amount of dashes.
My question is: how would I go about coding this if I am using a mouse to control where the shot goes?
Player-.-.-.-.-.-.-.-.-.- X
Player- . - . - . - . - . - . - . - . - . - . X
Both lines have 10 dashes (don't mind the dots), but one goes farther than the other. The dashes are all equally spaced out regardless of the distance or angle, and there is a set amount of dashes.
My question is: how would I go about coding this if I am using a mouse to control where the shot goes?