BIG MOVES
This commit is contained in:
26
semestralka1/src/game/state.h
Normal file
26
semestralka1/src/game/state.h
Normal file
@@ -0,0 +1,26 @@
|
||||
// src/game/state.h
|
||||
#pragma once
|
||||
#include "mbed.h"
|
||||
#include "../assets/character_frames.h"
|
||||
|
||||
constexpr auto CRAWL_DURATION = 300ms;
|
||||
|
||||
enum class PlayerState { Walk1, Walk2, Crawl1 };
|
||||
|
||||
class WalkingState {
|
||||
private:
|
||||
PlayerState current_state = PlayerState::Walk1;
|
||||
Timer state_timer;
|
||||
|
||||
public:
|
||||
// Update state (handles crawl timeout)
|
||||
void update();
|
||||
|
||||
// State transitions
|
||||
void start_crawl();
|
||||
void toggle_walk_frame();
|
||||
|
||||
// Getters
|
||||
PlayerState get_state() const { return current_state; }
|
||||
CharacterFrame get_character_frame() const;
|
||||
};
|
||||
Reference in New Issue
Block a user