about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile6
-rw-r--r--net.iotib.Pong.yml15
m---------raylib0
-rw-r--r--src/launch.sh5
-rw-r--r--src/main.c3
6 files changed, 24 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index fafa67f..669871f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 app/
 *.o
-pong
\ No newline at end of file
+pong
+.flatpak-builder
+flatpak/
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 8f393bf..f9e7343 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ build: src/main.c src/enemy.c src/ball.c src/title.c
 	$(CC) $(CFLAGS) $(PKG_CONF_CFLAGS) -c $?
 
 pong: main.o enemy.o ball.o title.o
-	$(CC) $? -o $@ raylib/src/libraylib.a $(LDFLAGS)
+	$(CC) $? -o $@ raylib/libraylib.a $(LDFLAGS)
 
 install:
 	mkdir -p app
@@ -22,8 +22,12 @@ install_flatpak:
 	mkdir -p /app/Pong
 	install -Dm755 ./pong /app/Pong/pong
 	cp -r resources/ /app/Pong/resources
+	mkdir -p /app/bin
+	install -Dm755 src/launch.sh /app/bin/launch.sh
 
 clean:
 	rm -fv *.o
 	rm -fv pong
+	rm -rf .flatpak-builder
+	rm -rf flatpak
 	cd raylib/src && $(MAKE) clean
diff --git a/net.iotib.Pong.yml b/net.iotib.Pong.yml
index 49d10bd..5655c4b 100644
--- a/net.iotib.Pong.yml
+++ b/net.iotib.Pong.yml
@@ -2,19 +2,22 @@ app-id: net.iotib.Pong
 runtime: org.freedesktop.Platform
 runtime-version: '21.08'
 sdk: org.freedesktop.Sdk
-command: /app/Pong/Pong
+command: launch.sh
 modules:
   - name: Pong
     buildsystem: simple
     build-commands:
       - make
-      - mkdir -p /app/Pong
-      - cp -r resources /app/Pong
-      - install -Dm755 Pong /app/Pong/Pong
+      - make install_flatpak
     sources:
       - type: file
         path: Makefile
       - type: dir
-        path: src/
+        path: src
+        dest: src
       - type: dir
-        path: resources/
\ No newline at end of file
+        path: resources
+        dest: resources
+      - type: dir
+        path: raylib
+        dest: raylib
\ No newline at end of file
diff --git a/raylib b/raylib
-Subproject d0318aac4a7fada53bf3cf5be6d2128db7cff5c
+Subproject 0851960397f02a477d80eda2239f90fae14dec6
diff --git a/src/launch.sh b/src/launch.sh
new file mode 100644
index 0000000..7449fcb
--- /dev/null
+++ b/src/launch.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This file is only for flatpak.
+
+cd /app/Pong
+./pong $@
\ No newline at end of file
diff --git a/src/main.c b/src/main.c
index d4120e8..280b16c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -103,7 +103,6 @@ int main() {
 	//Populate Audio Queue
 	for(int i = 0; i < sizeof(AudioQueue); i++) {
 		AudioQueue[i] = -1;
-		printf("%d\n", AudioQueue[i]);
 	}
 	mtx_init(&AudioQueueBeingModified, mtx_plain);
 
@@ -114,6 +113,7 @@ int main() {
 
 	// Init Enemy Variables
 	struct Players Enemy;
+	Enemy.Y = 0;
 	Enemy.Score = 0;
 	Enemy.Direction = 0;
 	char EnemyScore[50];
@@ -198,6 +198,7 @@ int main() {
 		//Turn Scores into strings.
 		snprintf(PlayerScore, 50, "Player: %d", Player.Score);
 		snprintf(EnemyScore, 50, "Enemy: %d", Enemy.Score);
+		printf("%f\n", Enemy.Y);
 		
 		BeginDrawing();
 			ClearBackground(BLACK);