From: Clyne Sullivan Date: Sat, 1 Mar 2025 21:18:02 +0000 (-0500) Subject: collision tweak X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=374005137721b99bca01c8368437641bc2984228;p=clyne%2Fgame.git collision tweak --- diff --git a/main.cpp b/main.cpp index 9f191a7..30e9f8d 100644 --- a/main.cpp +++ b/main.cpp @@ -67,7 +67,11 @@ int main(int argc, const char *argv[]) [®istry](auto& s, auto& p) { registry.view().each( [&s, &p](auto& _, auto& pp, auto& pv, auto& pt) { - if (const auto c = s.collision(pp + pt.dim()); c) { + auto dim = pt.dim(); + + if (const auto c = s.collision(pp + dim); c) { + pv.y = (std::abs(c) > 1.f) ? c * 0.25f : 0.f; + } else if (const auto c = s.collision(pp + Point(0, dim.y)); c) { pv.y = (std::abs(c) > 1.f) ? c * 0.25f : 0.f; } else { pv.y += 0.1f;