From 0dae96161a99158815a8075b5c405a35b0939936 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sun, 22 Dec 2024 17:26:27 +0100 Subject: fix Player prefab --- game/prefab/PlayerScript.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'game/prefab/PlayerScript.cpp') diff --git a/game/prefab/PlayerScript.cpp b/game/prefab/PlayerScript.cpp index e4a4951..67aadb6 100644 --- a/game/prefab/PlayerScript.cpp +++ b/game/prefab/PlayerScript.cpp @@ -6,21 +6,10 @@ using namespace crepe; using namespace std; -PlayerScript::PlayerScript(PlayerObject * player) : player(player) { - logf(Log::DEBUG, "PlayerScript: [C] player {}", (void*) &(*player)); - logf(Log::DEBUG, "PlayerScript: [C] player.body {}", (void*) &(player->body)); - logf(Log::DEBUG, "PlayerScript: [C] player.body.id {}", (void*) &(player->body.game_object_id)); -} - -void PlayerScript::init() { - logf(Log::DEBUG, "PlayerScript: [C] player {}", (void*) &(*player)); - logf(Log::DEBUG, "PlayerScript: [C] player.body {}", (void*) &(player->body)); - logf(Log::DEBUG, "PlayerScript: [C] player.body.id {}", (void*) &(player->body.game_object_id)); - player->controller.active = false; -} +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 }); + player.body.add_force_linear({ 0, -10 }); } -- cgit v1.2.3