Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void healthSystem();

// Globals
Monster mnst[50];
int lvl = 1;
int lvl = 0;

// Update Function
void Update()
Expand All @@ -36,9 +36,9 @@ int main()
ToggleFullscreen();

// Initializing Monsters
for (int i = 1; i <= 50; i++)
for (int i = 0; i < 50; i++)
{
mnst[i].createMonster(i, i * 100);
mnst[i].createMonster(i + 1, (i + 1) * 100);
mnst[i].screendimension(ScreenWidth, ScreenHeight);
}

Expand All @@ -55,7 +55,7 @@ int main()
}

// Cleaning
for (int i = 1; i <= 50; i++)
for (int i = 0; i < 50; i++)
{
UnloadTexture(mnst[i].monsterTexture());
}
Expand All @@ -69,7 +69,7 @@ int main()

void drawElements()
{
if (lvl == mnst[lvl].monsterNumber())
if (lvl + 1 == mnst[lvl].monsterNumber())
{
mnst[lvl].drawRes();
}
Expand All @@ -85,7 +85,7 @@ void Controls()

void healthSystem()
{
if (mnst[lvl].monsterHealth() == 0)
if (mnst[lvl].monsterHealth() == 0 && lvl < 49)
{
lvl++;
}
Expand Down
2 changes: 1 addition & 1 deletion res/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Monster
return health;
}

int monsterHealthchanger(int he_lth)
void monsterHealthchanger(int he_lth)
{
health = he_lth;
}
Expand Down