Hi,
Quote:Original post by graveyard filla
bullets can fire in 360 degrees, any direction. velocity must be calculated with each shot.
i dont have a Point class, and dont want to implement one either. thats something that i should have done months ago.
Well, you should do it now then. The more you wait, the bigger the problem will be. Points and vectors are rather simple objects, the code is straightforward. You can update older code later - you don't have to make your code Point-class aware at the time you are writing the Point class. Do a progressive change - but fo it.
Quote:Original post by graveyard filla
but, even then, this would lead to the same problem, unless i did something kind of ugly and had one ctor take a Point and the other take 2 floats.
I guess it would bo a better idea. Having a Point class and a Vector class don't hurt and may allow you to write better code:
Bullets::Bullets(const Point& start, const Point& dest, Character *shooter, Uint32 timestamp){}Bullets::Bullets(const Point& start, const Vector& velocity, Character *shooter, Uint32 timestamp){}
Using them:
Bullet bullet0(Point(x,y), Point(xdest, ydest), shooter, ts);Bullet bullet1(Point(x,y), Vector(xdest-x, ydest-y), shooter, ts);
Quote:Original post by graveyard filla
so far im thinking the best idea is to just re-order the parameters, e.g., put Character* shooter as the first parameter in the first constructor version. i guess i was just hoping there would be some clever trick for this.
Don't do this: having the same parameters in different order may produce ugly code (and therefore eye cancer).
Anyway, Great Old One Oluseyi probably got it right: is there a conceptual (read: not related to implementation) need for these 2 different-but-not-so-different ctors?
Regards,