Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

- Added the game name and made by at the top before the game starts. #4

Merged
merged 1 commit into from
Jan 29, 2024
Merged
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
6 changes: 6 additions & 0 deletions PacAttack/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ int main()
bool gameNotStarted = true;
unsigned char level = 1;
long curr_score = -4400; // -4400 because it counts already empty cells
long high_score = curr_score;

std::array<Position, 4> init_ghost_pos;

Expand Down Expand Up @@ -163,6 +164,7 @@ int main()
{
new_pellets -= 1;
curr_score += 50;
high_score = std::max(curr_score, high_score);
added_map[row][col] = true;
}
}
Expand All @@ -184,6 +186,7 @@ int main()
if (fright[iter] == FRIGHT::FULLY && added_ghost[iter] == false)
{
curr_score += 500;
high_score = std::max(curr_score, high_score);
added_ghost[iter] = true;
}
}
Expand Down Expand Up @@ -238,6 +241,7 @@ int main()
if (gameNotStarted == false)
{
DrawText("Score: " + std::to_string(curr_score), window, false, 0.f, -0.6f, CELL_SIZE / 2);
DrawText("HighScore: " + std::to_string(high_score), window, false, 10.f, -0.6f, CELL_SIZE / 2);
}

if (pacman.get_animation_over())
Expand All @@ -254,6 +258,8 @@ int main()

if (gameNotStarted)
{
DrawText("PacAttack", window, false, 5.f, -0.6f, CELL_SIZE / 2);
DrawText("-by deepencoding", window, false, 10.5f, -0.3f, CELL_SIZE / 3);
DrawText("Enter or Space", window, true, true);
}

Expand Down