Skip to content

Commit 65f7fdb

Browse files
merge pull request
feat(game): add scoreboard system with live and final score display Merge pull request #15 from PresenceOP-Coder/scoreboard
2 parents b1dc4dc + ee42ccc commit 65f7fdb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/homepage.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class _HomepageState extends State<Homepage> {
2929
backgroundColor: Colors.brown,
3030
title: const Text('Game Over', style: TextStyle(color: Colors.white)),
3131
content: Text(
32-
'Your bird has fallen!\nScore: $score',
32+
'Your bird has fallen!\nScore: $score',//display the score when game is over
3333
style: const TextStyle(color: Colors.white),
3434
),
3535
actions: [
@@ -61,7 +61,7 @@ class _HomepageState extends State<Homepage> {
6161
barrierx1 -= 0.05;
6262
barrierx2 -= 0.05;
6363

64-
// Reposition barriers and increase score
64+
// Reposition barriers and score incremented by 1 for each barrier passed
6565
if (barrierx1 < -1.5) {
6666
barrierx1 = 1.5;
6767
score++;
@@ -157,6 +157,7 @@ class _HomepageState extends State<Homepage> {
157157
style: const TextStyle(color: Colors.white),
158158
),
159159
),
160+
//score board implemented
160161
if (isGameStarted)
161162
Container(
162163
alignment: const Alignment(-0.8, -0.8),

0 commit comments

Comments
 (0)