Skip to content

Commit

Permalink
Fixed Kraken generation error
Browse files Browse the repository at this point in the history
  • Loading branch information
bgb10 committed Dec 7, 2020
1 parent 560505c commit 812f525
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/GameManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void GameManager::Play()
}

// Generate entities
if(player.GetVelocityY() > 0.5f) m_ObjectGenerator.Generate(m_ObjectManager, m_SceneManager);
m_ObjectGenerator.Generate(m_ObjectManager, m_SceneManager);

Update();
}
Expand Down
2 changes: 1 addition & 1 deletion src/GameObject/MovableObject/Kraken.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void Kraken::Move(double delta_time)
// adjust speed relative to user speed
if (player->GetSpeed() > 0.5f)
{
this->SetSpeedByFactor((player->GetSpeed() * 1.00001) / this->GetSpeed());
this->SetSpeedByFactor((player->GetSpeed() * 1.1f) / this->GetSpeed());
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/ObjectGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void ObjectGenerator::Generate(ObjectManager& objectManager, SceneManager& scene
{
// Kraken check
extern int score;
if (kraken_score + 400 < score) {
if (kraken_score + 300 < score) {
kraken_score = 0;
objectManager.SetKraken(false);
}
Expand Down
6 changes: 3 additions & 3 deletions src/ObjectGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class ObjectGenerator{
private:
int level = 0;
const float chance_map[3][5] = {
{0.001f, 0.02f, 0.01f, 0.02f, 0.02f},
{0.002f, 0.025f, 0.02f, 0.02f, 0.025f},
{0.003f, 0.03f, 0.025f, 0.015f, 0.03f},
{0.5f, 0.02f, 0.01f, 0.02f, 0.02f},
{0.6f, 0.025f, 0.02f, 0.02f, 0.025f},
{0.8f, 0.03f, 0.025f, 0.015f, 0.03f},
};
int kraken_score = 0;
public:
Expand Down

0 comments on commit 812f525

Please sign in to comment.