uncommented code
This commit is contained in:
@@ -50,7 +50,8 @@ Enemy::Enemy(Engine* engine, const EnemyInfo& t_info) {
|
|||||||
mesh->translation.translateY(-5.0F);
|
mesh->translation.translateY(-5.0F);
|
||||||
|
|
||||||
audio = &engine->audio;
|
audio = &engine->audio;
|
||||||
audio->adpcm.setVolume(30, info.adpcmChannel);
|
audio->adpcm.setVolume(5, info.adpcmChannel);
|
||||||
|
// audio->adpcm.setVolume(30, info.adpcmChannel); // TEMP
|
||||||
|
|
||||||
allocateOptions();
|
allocateOptions();
|
||||||
|
|
||||||
@@ -87,9 +88,9 @@ void Enemy::update(const Heightmap& heightmap, const Vec4& playerPosition,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Enemy::handlePlayerShoot(const PlayerShootAction& shootAction) {
|
void Enemy::handlePlayerShoot(const PlayerShootAction& shootAction) {
|
||||||
// if (!shootAction.isShooting) {
|
if (!shootAction.isShooting) {
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
const auto& ray = shootAction.ray.value();
|
const auto& ray = shootAction.ray.value();
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ EnemyManager::EnemyManager(Engine* engine, const Heightmap& heightmap) {
|
|||||||
auto* sample = engine->audio.adpcm.load(
|
auto* sample = engine->audio.adpcm.load(
|
||||||
FileUtils::fromCwd("game/models/zombie/punch.adpcm"));
|
FileUtils::fromCwd("game/models/zombie/punch.adpcm"));
|
||||||
|
|
||||||
const int enemyCount = 1;
|
const int enemyCount = 5;
|
||||||
for (int i = 0; i < enemyCount; i++) {
|
for (int i = 0; i < enemyCount; i++) {
|
||||||
EnemyInfo info;
|
EnemyInfo info;
|
||||||
info.adpcmChannel = 9 + i;
|
info.adpcmChannel = 9 + i;
|
||||||
|
|||||||
@@ -86,12 +86,12 @@ void GameState::update() {
|
|||||||
renderer.render();
|
renderer.render();
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
auto& utility = engine->renderer.renderer3D.utility;
|
// auto& utility = engine->renderer.renderer3D.utility;
|
||||||
utility.drawBox(*player->getCameraInfo().looksAt, 0.3F);
|
// utility.drawBox(*player->getCameraInfo().looksAt, 0.3F);
|
||||||
|
|
||||||
auto* firstEnemy = enemyManager->getPairs().front()->mesh;
|
// auto* firstEnemy = enemyManager->getPairs().front()->mesh;
|
||||||
utility.drawBBox(firstEnemy->getCurrentBoundingBox().getTransformed(
|
// utility.drawBBox(firstEnemy->getCurrentBoundingBox().getTransformed(
|
||||||
firstEnemy->getModelMatrix()));
|
// firstEnemy->getModelMatrix()));
|
||||||
|
|
||||||
// End frame
|
// End frame
|
||||||
engine->renderer.endFrame();
|
engine->renderer.endFrame();
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ PlayerShootAction Player::getShootAction() const {
|
|||||||
PlayerShootAction action;
|
PlayerShootAction action;
|
||||||
action.isShooting = weapon.isShooting;
|
action.isShooting = weapon.isShooting;
|
||||||
|
|
||||||
// if (action.isShooting) {
|
if (action.isShooting) {
|
||||||
action.ray = Ray(camera.position, camera.lookAt.getNormalized());
|
action.ray = Ray(camera.position, camera.lookAt.getNormalized());
|
||||||
// }
|
}
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user