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

Tracking Moves and Time

メニューを表示するにはスワイプしてください

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

Here's what you'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.

Note
Prompt in Cursor

Let's add progress tracking. Count how many moves the player makes, where one move means flipping two cards. Add a timer that starts when the game begins, pauses whenever a fun fact pop-up is open, and resumes when the pop-up is closed. The timer should stop completely when the last pair is matched. Show both the move counter and the timer during the game. When the win screen appears, display the total moves and the total time together with the "You won!" message. Make sure everything resets correctly when the player starts a new game.

question mark

Which features must be included to track player progress as described in the prompt?

すべての正しい答えを選択

すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  5

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

セクション 1.  5
some-alt