#include "Brute.h" Brute::Brute(Persos_Gest* persosGest, bool allie) : IACtrl(persosGest, allie), m_aglStrafe(0.0f), m_focusID(65535), m_cote() { if ( rand()%2 ) m_cote = 1; else m_cote = -1; } Brute::~Brute() {}//Ne rien détruire void Brute::update() { ///Rafraichit focus if ( !m_persosGest->getVivant(m_focusID, !m_allie) ) m_focusID = focusProche( !m_allie ); ///Visee m_visee = m_persosGest->getPos( m_focusID, !m_allie ) - m_moi->getPos(); ///Mouvement if ( m_focusID == NO_FOCUS ) { m_mvt.setVecteur(0.0f,0.0f,0.0f); } else { m_mvt = m_visee; if ( m_mvt.norme() < 350.0 && ( m_aglStrafe <= 90.f || m_aglStrafe >= 90.f )) m_aglStrafe += 4.5f*m_cote; else if ( m_aglStrafe != 0.0f ) m_aglStrafe -= 4.5f*m_cote; m_mvt.rotateD( m_aglStrafe ); } ///Tir if ( m_mvt.norme() < 380.0 && m_focusID != NO_FOCUS ) m_tir[ L_HAND ] = m_tir[ R_HAND ] = true; else m_tir[ L_HAND ] = m_tir[ R_HAND ] = false; m_mvt.normaliser(); } ///END FICHIER