Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Tracking Moves and Time | Building Your First Game Flip Cards
Build Games with Cursor AI

bookTracking Moves and Time

The game is fun and rewarding, let's make it more engaging by tracking how well the player performs. We'll count their moves and measure their time, then show the results when the game ends.

Here's what we'll add in this step.

Move counter.
expand arrow
  • One move equals flipping two cards;
  • The counter increases every time the player makes a new attempt.
Timer.
expand arrow
  • Starts when the first card is flipped;
  • Pauses whenever a Fun Fact pop-up is open;
  • Resumes when the pop-up is closed;
  • Stops completely once the final pair is matched.
Win screen update.
expand arrow

Alongside the "You won! πŸŽ‰" message, also show the player's total moves and total time.

Reset on new game.
expand arrow

Both the move counter and timer should reset properly when the player starts again.

question mark

When the win screen appears in our app, what extra information is shown besides "You won! πŸŽ‰"?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 5

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

How can I implement the move counter and timer in my game?

What should I do to ensure the timer pauses and resumes correctly with the fun fact pop-up?

How do I reset all progress tracking when starting a new game?

Awesome!

Completion rate improved to 6.67

bookTracking Moves and Time

Swipe to show menu

The game is fun and rewarding, let's make it more engaging by tracking how well the player performs. We'll count their moves and measure their time, then show the results when the game ends.

Here's what we'll add in this step.

Move counter.
expand arrow
  • One move equals flipping two cards;
  • The counter increases every time the player makes a new attempt.
Timer.
expand arrow
  • Starts when the first card is flipped;
  • Pauses whenever a Fun Fact pop-up is open;
  • Resumes when the pop-up is closed;
  • Stops completely once the final pair is matched.
Win screen update.
expand arrow

Alongside the "You won! πŸŽ‰" message, also show the player's total moves and total time.

Reset on new game.
expand arrow

Both the move counter and timer should reset properly when the player starts again.

question mark

When the win screen appears in our app, what extra information is shown besides "You won! πŸŽ‰"?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 5
some-alt