Skip to content

Commit 1ffb9d9

Browse files
committed
Add Pong game with full cross-platform support and README
1 parent eeff174 commit 1ffb9d9

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

games/pong/.DS_Store

6 KB
Binary file not shown.

games/pong/Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@ CFLAGS = -Wall -std=c99
33
SRC = main.c
44
OUT = game
55

6-
LIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
6+
UNAME_S := $(shell uname -s)
7+
8+
ifeq ($(UNAME_S),Linux)
9+
LIBS = -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
10+
endif
11+
12+
ifeq ($(UNAME_S),Darwin)
13+
LIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
14+
endif
15+
16+
ifeq ($(OS),Windows_NT)
17+
LIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
18+
OUT := game.exe
19+
endif
720

821
$(OUT): $(SRC)
922
$(CC) $(CFLAGS) $(SRC) -o $(OUT) $(LIBS)

games/pong/README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
# Pong Game in C
1+
# My Raylib Game
22

3-
A simple Pong game written in C using Raylib.
3+
A simple game built using [Raylib](https://www.raylib.com/) and C.
44

5-
## How to Build
5+
## Build Instructions (macOS/Linux)
66

7-
Make sure you have [raylib](https://www.raylib.com/) installed, then:
7+
Make sure you have Raylib installed.
8+
9+
### macOS
10+
Install Raylib via Homebrew:
811

912
```bash
10-
make
11-
./game
13+
brew install raylib
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+

games/pong/game

2.18 MB
Binary file not shown.

0 commit comments

Comments
 (0)