SNAKE_STM32F3
Loading...
Searching...
No Matches
game.h File Reference

High-level game state machine module controlling application flow. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void game_loop (void)
 Main game state machine function.
void game_init (void)
 Main game init function.
void game_start_request (int game_seed)
 Requests start of the game in state machine.
void game_tick_request (void)
 Requests one tick game progression (one snake move) in state machine.

Detailed Description

High-level game state machine module controlling application flow.

Author
bslrd
Date
2026

SPDX-License-Identifier: MIT

Function Documentation

◆ game_init()

void game_init ( void )

Main game init function.

Note
Should be called from main() to initialize first menu.
Here is the call graph for this function:

◆ game_loop()

void game_loop ( void )

Main game state machine function.

Handles two application states (MENU, GAME).

Note
Should be called from main() while loop.
Here is the call graph for this function:

◆ game_start_request()

void game_start_request ( int game_seed)

Requests start of the game in state machine.

Parameters
game_seedSeed used for random fruit position generator.
Note
Should be called from start button interrupt.

◆ game_tick_request()

void game_tick_request ( void )

Requests one tick game progression (one snake move) in state machine.

Note
Should be called from timer interrupt with desired snake movement frequency.