Jump to content

  • Log In with Google      Sign In   
  • Create Account






Collision and Jumping

Posted by newtechnology, 15 June 2014 · 335 views



Hello again! This time I've added jump feature and even added a weapon manager to handle all weapons. The weapon manager assigns each weapon a name and an index so, any weapon can be accessed either by name or index. The look of weapons can be changed and saved on the disk using... See more




I think you need to increase the widths of that bounding box. Weapons manager? These kids and their C++ singletons... There's no such thing as a weapons manager found in real life. Classes are made to imitate real world objects. But do as you wish.

I think you need to increase the widths of that bounding box. Weapons manager? These kids and their C++ singletons... There's no such thing as a weapons manager found in real life. Classes are made to imitate real world objects. But do as you wish.

I was talking about weapon manager in the source code not in the game!

Weapon manager avoids duplication of weapons and makes it easy to access weapons in the source code. sleep.png

 

This is what i was talking about:

class WeaponManager
{
private:
WeaponManager(const WeaponManager& rhs);
WeaponManager& operator=(const WeaponManager& rhs);
public:
WeaponManager();
~WeaponManager();
 
void pushback_PrimaryWeapon(const std::string& name, Weapon* weapon);
void pushback_SecondaryWeapon(const std::string& name, Weapon* weapon);
 
Weapon* GetPrimaryWeapon(UINT ArrayIndex);
Weapon* GetPrimaryWeaponByName(const std::string& name);
 
Weapon* GetSecondaryWeapon(UINT ArrayIndex);
Weapon* GetSecondaryWeaponByName(const std::string& name);
 
UINT GetNumWeapons(); //returns sum of primary + secondary
UINT GetNumPrimaryWeapons();  //returns number of primary weapons 
UINT GetNumSecondaryWeapons(); //returns number of secondary weapons
 
private:
std::vector<std::string> mPrimaryWeaponNames;
std::vector<std::string> mSecondaryWeaponNames;
 
std::vector<Weapon*> mWeapons;
std::vector<Weapon*> mSecondaryWeapons;
};

August 2014 »

S M T W T F S
     12
3456789
10111213141516
171819202122 23
24252627282930
31      

Recent Entries

Recent Comments

MyJournalLog

MyJournalLog

PARTNERS