melonpan0130 / Come_back_home

This is game that girl going home. (seems to survival game)
0 stars 0 forks source link

player shoot forward - payload #6

Closed melonpan0130 closed 5 years ago

melonpan0130 commented 5 years ago

made payload shoot forward by using onFire function of CPayload class. // in payload class void OnFire(const D3DXVECTOR3& pos, const D3DXVECTOR3& dir) { m_Alive = true; m_Pos = pos; D3DXVec3Normalize(&m_Dir, &dir); }

// in gameFramework class (main class) if (m_Input->IsPressed(DIK_W)) // shoot to up m_PlayerPM->OnFire(m_Player->getPosition(), D3DXVECTOR3(0.f, -1.f, 0.f)); if (m_Input->IsPressed(DIK_D)) // shoot to right m_PlayerPM->OnFire(m_Player->getPosition(), D3DXVECTOR3(1.f, 0.f, 0.f)); if (m_Input->IsPressed(DIK_A)) // shoot to left m_PlayerPM->OnFire(m_Player->getPosition(), D3DXVECTOR3(-1.f, 0.f, 0.f));