aboutsummaryrefslogtreecommitdiff
path: root/game/prefab/PlayerScript.cpp
blob: 67aadb65ab7d37a94ffbef1c96e25788f72502a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <crepe/api/Rigidbody.h>
#include <cassert>

#include "PlayerScript.h"

using namespace crepe;
using namespace std;

PlayerScript::PlayerScript(const PlayerObject & player) : player(player) { }

void PlayerScript::fixed_update(crepe::duration_t dt) {
	if (this->get_key_state(Keycode::SPACE))
		player.body.add_force_linear({ 0, -10 });
}