peck
peck
CC#
Created by peck on 10/1/2023 in #help
❔ raylib c# 2d collison
my code is this when ever i go on the or bottom is slides off and when i go to the right on it theres likea pixel gap is there any examples of collision sorry i done it rlly wrong
c#
if(CheckCollisionRecs(p.rec, t.rec) && t.col)

{

if(p.rec.x >= t.rec.x) { p.rec.x += p.speed * GetFrameTime(); }

if(p.rec.x <= t.rec.x) { p.rec.x -= p.speed * GetFrameTime(); }

if (p.rec.y >= t.rec.x) { p.rec.y += p.speed * GetFrameTime(); }

if (p.rec.y <= t.rec.x) { p.rec.y -= p.speed * GetFrameTime(); }



}
c#
if(CheckCollisionRecs(p.rec, t.rec) && t.col)

{

if(p.rec.x >= t.rec.x) { p.rec.x += p.speed * GetFrameTime(); }

if(p.rec.x <= t.rec.x) { p.rec.x -= p.speed * GetFrameTime(); }

if (p.rec.y >= t.rec.x) { p.rec.y += p.speed * GetFrameTime(); }

if (p.rec.y <= t.rec.x) { p.rec.y -= p.speed * GetFrameTime(); }



}
2 replies
CC#
Created by peck on 9/21/2023 in #help
❔ has anyone got any ideas for a program for like a begnniner with like a ui like raylib?
i am learning c# an i want to get a idea for a basic thing i can make with like raylib a graphics lib or window forms
4 replies