Skip to content

sebabilla/balls_in_the_wind

Repository files navigation

Balls in the wind

by Sébastien Abilla

GNU/GPL v3 (voir LICENSE)

Video Demo:

https://youtu.be/5_iF-iuUEvs

Play online:

https://seb46.itch.io/balls-in-the-wind

Description:

  • Use arrow keys to control the wind and attempt to align the balls in the correct order.
  • Press Enter to Capture the position (in flight okay).
  • I've never managed to go till the 6 balls' stage by playing fairly. Will you manage to reach this last stage and clear it? :)​

CS50x's final project. It's coded in C and exported in js/wasm with emscriptem. All the interactions are coded as force vectors applied to the balls. It's inspired by the Nature of Code, excellent Javascript Edutainment on Daniel Shiffman's Coding Train channel.

Source code

Aperçu

Credits

Courses and tutorials
Sounds
Font

Files

  • main.c - main game loop prepared for alternative compilation by gcc or emcc
  • jeu.* - in game mechanics
  • vecteur.* - vectors' maths
  • physique.* - Newtonian physics, forces -> acceleration -> speed -> position
  • affichage.* - display controled using SDL
  • musique.* - sounds controled using SDL Mixer
  • controle.* - player inputs

Directories

  • res - files loaded by the game: music and sounds (.ogg), texts in different languages (.txt), font, and image
  • balls_in_the_wind - files generated by emcc, index.html simplified to a minimum Javascript canvas

Compilation

GNU/Linux running file

gcc *.c -Wall -o balls_in_the_wind -lm $(sdl2-config --cflags --libs) -lSDL2_gfx -lSDL2_ttf -lSDL2_mixer

Web Assembly compilation and companion files running in a web browser

emcc *c -O2 -s USE_SDL=2 -s USE_SDL_TTF=2 --preload-file res/ -s USE_SDL_GFX=2 -s USE_SDL_MIXER=2 -s ALLOW_MEMORY_GROWTH -o balls_in_the_wind.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published