Пример #1
0
void Stalfos::update(std::vector<std::shared_ptr<GameObject>>* worldMap) {
	if (isCollidingWithPlayer(worldMap)){
		Player* temp = (Player*)findPlayer(worldMap).get();
		temp->takeDamage(worldMap, this);
	}
	checkParalyzeStatus();
	if (isCollidingWithBoomerang(worldMap)){
		Sound::playSound(GameSound::EnemyHit);
		isParalyzed = true;
		ThrownBoomrang* boom = (ThrownBoomrang*)findBoomerang(worldMap).get();
		if (!boom->isReturning)
			boom->isReturning = true;
	}
	if (pushbackStep == 0 && !isParalyzed){
		movement(worldMap);
		tryToChangeDirection();
	}
	else if(pushbackStep!=0 && !isParalyzed)
		pushbackUpdate();
	for (int i = 0; i < 3; i++)
		walkingAnimation[i]->updateAnimationFrame(position);
	if (healthPoint <= 0)
		processDeath(worldMap);
	else checkInvincibility();
	updateMasks();
}
Пример #2
0
// -------------- update
void StencilWaves::update(){
    updateContours();
    updateWaveParameters();
    updateWaves();
    updateMeshes();
    updateFbos();
    updateMasks();
    updateRefract();
}