Beispiel #1
0
void EnemySprite::update(){
    elapsed += Clock::getInstance().getTicks();
    weapon.update(); 
    if(elapsed >= interval) {
            elapsed = 0;
            weapon.explode();
            throwObject();
    } 
    SmartSprite::update();
}
Beispiel #2
0
bool CLiftableObject::interactOnKeypress(EInteractType eInteractType, const Ogre::Vector3 &vInteractDir) {
	if (eInteractType == IT_USE) {
		return false;
	}
	else if (eInteractType == IT_ATTACK) {
		if (m_eState == LOS_LIFTED) {
			return throwObject();
		}
		return true;
	}
	else if (eInteractType == IT_LIFT) {
		if (m_eState == LOS_AT_DEFAULT_LOCATION) {
			return lift();
		}
		return false;
	}

	return false;
}