diff --git a/README.md b/README.md index 313663d..df45d76 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Avoid -A dumb raylib test which you can play [here](https://canneddonuts.itch.io/avoid-the-game) +

A dumb raylib test ## To-do - build guide/better Makefile - fix the dumb bug when the ball gets stuck +- make an HTML5 build diff --git a/build-html5.sh b/build-html5.sh deleted file mode 100755 index ccacebe..0000000 --- a/build-html5.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -emcc -o html5/index.html src/Main.c -Os -Wall /usr/local/lib/libraylib.a -I. -I/usr/local/include/raylib.h -L. -L/usr/local/lib/libraylib.a -s USE_GLFW=3 -DPLATFORM_WEB --preload-file assets/sfx/boing.wav --preload-file assets/bgm/01-Slipin-Sunday.ogg --shell-file html5/shell.html diff --git a/html5/Avoid_HTML5.zip b/html5/Avoid_HTML5.zip deleted file mode 100644 index 74c7987..0000000 Binary files a/html5/Avoid_HTML5.zip and /dev/null differ diff --git a/html5/shell.html b/html5/shell.html deleted file mode 100644 index fe022b1..0000000 --- a/html5/shell.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - - Avoid: the game - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- -
- -
- - - - - - - - - - {{{ SCRIPT }}} - - diff --git a/src/Main.c b/src/Main.c index aacd8d0..cd411a2 100644 --- a/src/Main.c +++ b/src/Main.c @@ -1,8 +1,7 @@ +#include "raylib.h" + #if defined(PLATFORM_WEB) - #include "/usr/local/include/raylib.h" #include -#else - #include "raylib.h" #endif // screen variables @@ -17,7 +16,6 @@ typedef struct Ball { Vector2 position; Vector2 speed; float radius; - float growth; Color color; bool active; } Ball; @@ -91,7 +89,6 @@ void GameInit(void) ball.position = (Vector2){ 50, 50 }; ball.radius = 20; - ball.growth = 2; ball.speed = (Vector2){ 400.0f, 400.0f }; ball.color = MAROON; ball.active = true; @@ -166,8 +163,11 @@ void UpdateGame(void) if (CheckCollisionCircleRec(ball.position, ball.radius, player.hitbox)) player.hp--; - - if (BallFrameCounter <= 2500) ball.radius += GetFrameTime() * ball.growth; + if (BallFrameCounter==1000) ball.radius = 40; + if (BallFrameCounter==2000) ball.radius = 50; + if (BallFrameCounter==3000) ball.radius = 60; + if (BallFrameCounter==4000) ball.radius = 70; + if (BallFrameCounter==5000) ball.radius = 80; } if (player.hp <= 0) currentScreen = GAMEOVER;