What i was hoping to accomplish is a general method in the Manager which gets called every time a request for a projectile is made. it then creates a new projectile on the heap of the type needed (in this case a rifle ammo shot). here is the base class code:
class CProjectile{public: CProjectile(); ~CProjectile(); virtual void Update(); virtual CProjectile *GetNextProjectile(); virtual void SetNextProjectile(CProjectile* pNextOne); virtual void SetTexture(LPDIRECT3DTEXTURE8 Texture);private: LPDIRECT3DTEXTURE8 ProjectileTexture; D3DXVECTOR2 Translation; D3DXVECTOR2 RotationCenter; D3DXVECTOR2 Scale; D3DXVECTOR2 Velocity; D3DXVECTOR2 Position; D3DXVECTOR2 StartingPos; CProjectile *pNextProjectile; bool bAlive;};CProjectile::CProjectile(){ ProjectileTexture = 0; Translation.x = 0.0f; Translation.y = 0.0f; RotationCenter.x = 0.0f; RotationCenter.y = 0.0f; Scale.x = 1.0f; Scale.y = 1.0f; bAlive = false; Velocity.x = 0.0f; Velocity.y = 0.0f; Position.x = 0.0f; Position.y = 0.0f; StartingPos.x = 0; StartingPos.y = 0; ProjectileTexture = 0;}
this is kinda why a void pointer would work i think... the types change constantly, and i don''t want to create a pointer for each type of projectile texture, (unless i have to).
oh... you know what i could do is create a CProjectile* and then cast that as needed. i''m not sure that will work.. i will try it now.
but that is the general procedure... and what i am hoping to achieve.
Thanks for your help again, BTW..
------------------------------------------VOTE Patrick O'GradyWrite in Presidential CandidateThe Candidate who Cares.