I'm working on perfecting the Semi-Track which constantly follows the player until it is within a certain range. The two things I wanted Semi-Track to have, unlike its counterpart Aimed, is constant speed regardless of distance or the bullet and a non-impulsive behavior (the bullet would have to gradually change its course rather than perfectly track the player). My original plan involved using Trig functions and the good ol' Pythagoras Theorem to maintain the constant bullet speed as I can only direct the vertical and horizontal movements (or, the legs of a triangle, the components) of objects.
The original plan involved finding the angle between the bullet and the player, dblNewAngle, and comparing it to the previous angle found in the last cycle, dblOldAngle. Find an intermediate point between the two angles and use that angle to find the components of the velocity. It doesn't work and I will assume it is VB's own use of Trig and dooms me to finding an alternative method.
So, I visited my VB teacher from HS (thank god I'm only 10-15 minutes away at college, lol) and through talking with him I've come up with another solution: Perpetual Aiming.
It's impulsive but trig-less and I don't know quite yet how to maintain a constant speed (as noted, Aimed bullets' speed is determined by distance from the player and, if I felt inclined, if I ran the current Aimed speed determining code constantly, it would theoretically never reach you as each time it recalculates, it gets that much slower).
So that's the next puzzle... -_-'
No comments:
Post a Comment