Jump to content

  • Log In with Google      Sign In   
  • Create Account

lucky6969b

Member Since 06 Apr 2007
Offline Last Active Private

Posts I've Made

In Topic: Basic Game Object Communication

26 July 2016 - 08:22 PM

Sorry, a couple of typos....

 

D3DXVECTOR3 FindParkingSpot(const std::shared_ptr<GameObject>& pParkingPlace)
{
    D3DMATRIX matPark = pParkingPlace->FindFrame("ParkingPlace")->matCombined;
    return D3DXVECTOR3(matPark._41, matPark._42, matPark._43);
}
 
void Parking(const std::shared_ptr<GameObject>& pParkingPlace, const std::shared_ptr<GameObject>& pParkingVehicle) const
{
     D3DXVECTOR3 vParkSpot = FindParkingSpot(pParkingPlace);
     pParkingVehcle->setPosition(vParkSpot);
}

In Topic: Basic Game Object Communication

26 July 2016 - 08:20 PM

If like phil_t said, completely decoupled?

 

Maybe just like phil_t said,
 
[code]
D3DXVECTOR3 FindParkingSpot(const std::shared_ptr<GameObject>& pParkingPlace)
{
    D3DMATRIX matPark = pParkPlace->FindFrame("ParkingPlace")->matCombined;
    return D3DXVECTOR3(matPark._41, matPark._42, matPark._43);
}
 
void Parking(const std::shared_ptr<GameObject>& pParkingPlace, const std::shared_ptr<GameObject>& pParkingVehicle)
{
     D3DXVECTOR3 vParkSpot = FindParkingSpot(pParkingPlace);
     pParkingVehcle->setPosition(vParkSpot);
}

In Topic: Basic Game Object Communication

26 July 2016 - 08:06 PM

Thanks, buddies, It's all good.

But one thing to mention is, if the truck depends on many other stuff in my game.

Do I have a long parameter list to deal with? It's not the problem of the amount of typing.

The problem is if I extend the number of dependencies in the future, then would that become unmanagable?

Maybe I am wrong, please correct me if I am.

 

like this.

Truck::Truck(Warehouse* warehouse, Good* goods...)

 

 

If I understand you guys' concepts correctly

do it like that?

Truck::Truck(const std::vector<GameObject*>& depends....)

In Topic: How To Suppress Dx9 And Sdk 8 Conflict Warnings?

22 July 2016 - 11:29 PM

Thanks, works now...

Disabling C4005, or turn off warnings altogether


In Topic: Getting an error while running this program

03 July 2016 - 09:54 PM

Thanks, I'll try a lower version then

Have a nice day!

Jack


PARTNERS