1
0
Fork
You've already forked hot-or-cold
0
Implementação do projeto hot or cold, como demo do Game Loop.
  • C++ 97.3%
  • CMake 2.7%
2025年06月11日 15:03:56 -03:00
pics first commit 2025年06月11日 15:03:56 -03:00
source first commit 2025年06月11日 15:03:56 -03:00
.gitignore first commit 2025年06月11日 15:03:56 -03:00
CMakeLists.txt first commit 2025年06月11日 15:03:56 -03:00
LICENSE first commit 2025年06月11日 15:03:56 -03:00
README.md first commit 2025年06月11日 15:03:56 -03:00

Introduction

This project presents the implementation of the Hot or Cold game as a case study application of the game loop game pattern or architecture.

The objective of this repo is to help the novice programmer to understand how to model a simple game or simulation using the game loop pattern.

Hot or Cold Gameplay

Your goal is the guess a secret integer between 1 and N (>1). You repeatedly guess integers between 1 and N. After each guess you learn if it equals the secret integer (and the game stops); otherwise (starting with the second guess), you learn if the guess is hotter (closer to) or colder (farther from) the secret number than your previous guess.

You may find a description of the problem here.

Modeling the Game

The first modeling step is to conceive the Finite-State Machine model for the game logic. After that, it becomes relatively easy to know what to include in each of the three methods present in the loop: process(), update(), and render().

The image below depicts the Finite-State Machine model for the Hot or Cold game.

The following image presents a list of all possible messages that may be send to the user based on the current game state.