Zap'Em Blast'Em Robots
robots that play laser tag!
Loading...
Searching...
No Matches
GameTask Struct Reference

Structure that represents the game task state and configuration. More...

#include <game_task.h>

Data Fields

int32_t state
int32_t num_states
int32_t play_flag
int32_t score_red
int32_t score_blue
int32_t score_red_prev
int32_t score_blue_prev
int32_t score_thresh
int32_t num
uint32_t red_delay_start
uint32_t blue_delay_start
int32_t red_delay_flag
int32_t blue_delay_flag
uint32_t delay
uint32_t end_delay
SoundTasksound_task_ptr
PhotoresistorTaskred_photoresistor_task_ptr
PhotoresistorTaskblue_photoresistor_task_ptr
motor_tmred
motor_tmblue
I2C_HandleTypeDef * i2c_handle
game_fcn_t state_list []

Detailed Description

Structure that represents the game task state and configuration.

This structure holds all the variables and function pointers necessary to run game operations within the task-based state machine.

Field Documentation

◆ blue_delay_flag

int32_t blue_delay_flag

Blue in delay or not

◆ blue_delay_start

uint32_t blue_delay_start

Blue delay start time

◆ blue_photoresistor_task_ptr

PhotoresistorTask* blue_photoresistor_task_ptr

Pointer to Blue PhotoresistorTask object

◆ delay

uint32_t delay

Length of delay in ms

◆ end_delay

uint32_t end_delay

Length of end of game delay

◆ i2c_handle

I2C_HandleTypeDef* i2c_handle

Pointer I2C handle

◆ mblue

motor_t* mblue

Pointer to red motor object

◆ mred

motor_t* mred

Pointer to red motor object

◆ num

int32_t num

Counter variable

◆ num_states

int32_t num_states

Total number of states

◆ play_flag

int32_t play_flag

game in play mode

◆ red_delay_flag

int32_t red_delay_flag

Red in delay or not

◆ red_delay_start

uint32_t red_delay_start

Red delay start time

◆ red_photoresistor_task_ptr

PhotoresistorTask* red_photoresistor_task_ptr

Pointer to Red PhotoresistorTask object

◆ score_blue

int32_t score_blue

Blue fighter's score

◆ score_blue_prev

int32_t score_blue_prev

Blue's previous score

◆ score_red

int32_t score_red

Red fighter's score

◆ score_red_prev

int32_t score_red_prev

Red's previous score

◆ score_thresh

int32_t score_thresh

Score needed to to win

◆ sound_task_ptr

SoundTask* sound_task_ptr

Pointer to SoundTask object

◆ state

int32_t state

Current state index

◆ state_list

game_fcn_t state_list[]

Function pointer list for states


The documentation for this struct was generated from the following file: