speed control of player and the ground
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// src/game/state.cpp
|
||||
#include "state.h"
|
||||
#include "../render/player.h"
|
||||
#include "../timing/speed_controller.h"
|
||||
|
||||
void WalkingState::update() {
|
||||
// stop crawling after duration
|
||||
@@ -18,8 +19,8 @@ void WalkingState::start_crawl() {
|
||||
}
|
||||
|
||||
// TODO THIS NEEDS REDESIGN ACCORDING TO SPEED
|
||||
void WalkingState::toggle_walk_frame() {
|
||||
if ((run_index += 3) >= 7) run_index = 0;
|
||||
void WalkingState::toggle_walk_frame(int step) {
|
||||
run_index = (run_index + step) % 7;
|
||||
}
|
||||
// void RunningState::toggle_run_frame() {
|
||||
// if (++run_index >= 7) run_index = 0;
|
||||
|
||||
Reference in New Issue
Block a user