aboutsummaryrefslogtreecommitdiff
path: root/game/PlayerScript.cpp
blob: 1c388f53290131fa0f2932f9604ba9b25589fed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include "PlayerScript.h"

#include <crepe/api/Rigidbody.h>

using namespace crepe;
using namespace std;

void PlayerScript::fixed_update(crepe::duration_t dt) {
	Rigidbody & rb = this->get_components_by_name<Rigidbody>("player").front();
	if (this->get_key_state(Keycode::SPACE)) rb.add_force_linear(vec2(0, -10));
}