1 #include "Controller.h"
3 #include "../world/Entity.h"
4 #include "../graphics/const.h"
11 Controller::Controller(Entity *ent)
21 void Controller::Update(float delta) {
25 if (std::abs(e->acc.x) < moveTerm) {
26 e->acc.x = sigma(moving) * moveAcc;
31 e->acc.x = sigma(e->vel.x) * -moveAcc;
34 if (jumping && e->onGround) {
41 void Controller::MoveLeft() {
45 void Controller::StopLeft() {
49 void Controller::MoveRight() {
53 void Controller::StopRight() {
57 void Controller::StartJump() {
61 void Controller::StopJump() {