31 lines
1.3 KiB
C
31 lines
1.3 KiB
C
#ifndef GAME_LOGIC_H
|
|
#define GAME_LOGIC_H
|
|
|
|
#include "game_state.h"
|
|
|
|
void update_snake(GameState &state);
|
|
bool check_collision_self(GameState &state);
|
|
bool check_collision_apples(GameState &state);
|
|
bool check_collision_apples_rotten(GameState &state);
|
|
bool check_collision_apples_cursed(GameState &state);
|
|
void spawn_apples(GameState &state);
|
|
void spawn_apples_rotten(GameState &state);
|
|
void spawn_apples_cursed(GameState &state);
|
|
void tick_status_effects(GameState &state);
|
|
|
|
uint8_t calculate_intensity_31(const GameState &state);
|
|
uint16_t calculate_timer_freq_mhz(const GameState &state);
|
|
uint16_t calculate_timer_reload(const GameState &state);
|
|
|
|
// Hard-mode temporary barriers
|
|
void reset_barriers(GameState &state); // Main thread (init_game)
|
|
void tick_barriers_frame(GameState &state); // VBlank IRQ: advances lifetimes
|
|
void spawn_barriers(GameState &state); // Timer IRQ: spawns when cooldown expired
|
|
bool check_collision_barriers(GameState &state); // Timer IRQ: head vs. active barrier
|
|
bool is_barrier_cell(const GameState &state, int x, int y, bool include_warning);
|
|
uint16_t calculate_barrier_interval_frames(const GameState &state);
|
|
uint8_t calculate_barrier_max_length(const GameState &state);
|
|
uint8_t calculate_barrier_max_batch(const GameState &state);
|
|
|
|
#endif
|