made it compileable for macos
Some checks failed
Build Project / build (push) Has been cancelled

This commit is contained in:
swim67667
2026-06-24 11:42:00 -04:00
parent 2917fd3152
commit c29f652cdc
4 changed files with 15 additions and 26 deletions

View File

@@ -1,25 +1,5 @@
CC=gcc
SRC=src/main.c \
src/world.c \
src/player.c \
src/physics.c \
src/render.c \
src/collision.c
OUT=wrldbox
# On macOS, Homebrew usually installs raylib to /opt/homebrew
INCLUDES=-Iinclude -I/opt/homebrew/include
LIBPATH=-Llib -L/opt/homebrew/lib
CFLAGS=-O2 -Wall
# macOS-specific flags replacing Linux X11 dependencies
LIBS=-lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
all:
$(CC) $(SRC) $(CFLAGS) $(INCLUDES) $(LIBPATH) -o $(OUT) $(LIBS)
clean:
rm -f $(OUT)
gcc src/*.c -o wrldboxMacOS \
-I/opt/homebrew/include \
-L/opt/homebrew/lib \
-lraylib \
-framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo

View File

@@ -21,7 +21,16 @@ void checkCollision(){
(Vector2){-10000, 0}
);
}
if(fabsf(en1->position.y - en2->position.y) < (en1->size * 0.5f + en2->size * 0.5f))
if(fabsf(en1->position.y - en2->position.y) < (en1->size * 0.5f + en2->size * 0.5f)){
ApplyForce(
en1,
(Vector2){0, 10000}
);
ApplyForce(
en2,
(Vector2){0, -10000}
);
}
}
}
}

BIN
wrldbox

Binary file not shown.

BIN
wrldboxMacOS Executable file

Binary file not shown.