speed control of player and the ground

This commit is contained in:
Filipriec
2025-11-15 20:55:29 +01:00
parent 0ff2be6564
commit 2753aed573
6 changed files with 69 additions and 5 deletions

View File

@@ -0,0 +1,19 @@
// src/timing/speed_controller.h
#pragma once
#include "mbed.h"
class SpeedController {
private:
int ground_speed = 1;
public:
SpeedController() = default;
void set_ground_speed(int spd);
int get_ground_speed() const { return ground_speed; }
// Calculates how many frames to advance for current tick.
// Takes objects current speed and a global tick counter
// to automatically handle slower "wait" behavior.
int frame_advance_for(int object_speed, int tick_counter) const;
};