diff --git a/MakefileMacOS b/MakefileMacOS index bb2b7ee..26a848e 100644 --- a/MakefileMacOS +++ b/MakefileMacOS @@ -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) \ No newline at end of file +gcc src/*.c -o wrldboxMacOS \ +-I/opt/homebrew/include \ +-L/opt/homebrew/lib \ +-lraylib \ +-framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo \ No newline at end of file diff --git a/src/collision.c b/src/collision.c index 1420a1e..a104b7f 100644 --- a/src/collision.c +++ b/src/collision.c @@ -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} + ); + } } } } diff --git a/wrldbox b/wrldbox index 4c262f3..20926f3 100755 Binary files a/wrldbox and b/wrldbox differ diff --git a/wrldboxMacOS b/wrldboxMacOS new file mode 100755 index 0000000..f5d5605 Binary files /dev/null and b/wrldboxMacOS differ