#include "components/GravityWellComponent.hpp" #include "Entity.hpp" #include "components/TransformComponent.hpp" #include "raylib.h" #include void GravityWellComponent::Setup() {} void GravityWellComponent::Update(float dt) { auto transform = entity->GetComponent(); if (!transform) { return; } active = IsMouseButtonDown(MOUSE_BUTTON_LEFT); const Vector2 mouse = GetMousePosition(); auto &t = transform->get(); const float blend = std::clamp(followLerp * dt, 0.0f, 1.0f); t.x += (mouse.x - t.x) * blend; t.y += (mouse.y - t.y) * blend; } void GravityWellComponent::Cleanup() {}