https://github.com/Lallassu/bintris Skip to content Sign up * Why GitHub? + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} Lallassu / bintris Public * Notifications * Fork 0 * Star 40 * Binary Tetris GPL-3.0 License 40 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 2 branches 0 tags Code Latest commit @Lallassu Lallassu Update README.md ... 2b83364 Jan 11, 2022 Update README.md 2b83364 Git stats * 13 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time AndroidProject Minor fixups Jan 5, 2022 assets Working game Jan 5, 2022 raw_assets Added playstore images Jan 5, 2022 .gitignore Added java src Jan 5, 2022 AndroidManifest.xml Working game Jan 5, 2022 COPYING Added license Jan 5, 2022 Makefile Minor fixups Jan 5, 2022 OpenAL.license Working game Jan 5, 2022 README.md Update README.md Jan 11, 2022 about.go Working game Jan 5, 2022 effects.go Working game Jan 5, 2022 game.go Minor fixups Jan 5, 2022 gldata.go Working game Jan 5, 2022 go.mod Working game Jan 5, 2022 go.sum Working game Jan 5, 2022 howtoplay.go Working game Jan 5, 2022 main.go Minor fixups Jan 5, 2022 menu.go Working game Jan 5, 2022 mode.go Working game Jan 5, 2022 scoreboard.go Working game Jan 5, 2022 shaders.go Working game Jan 5, 2022 sound.go Minor fixups Jan 5, 2022 sprite.go Working game Jan 5, 2022 texture.go Working game Jan 5, 2022 tile.go Working game Jan 5, 2022 View code [ ] Bintris Bintris is a mobile game developed in Go! About The Game Demo On Youtube About The Implementation Building From Source Build For Android Build For Android Studio Details OpenAL Go Changes Required to Gomobile Command ADB Debug License README.md Bintris [f] [p] [b] [s] Bintris is a mobile game developed in Go! Support me by buying this game on Google PlayStore : https:// play.google.com/store/apps/details?id=go.lang.bintris Or you can of course build it from source yourself (see instructions below ). Enjoy! About The Game Bintris is a small game inspired by Tetris. The goal is to flip the bits so that the bits represent the decimal number in the right column. When the bits represent the decimal number the line is cleared and points are gathered. Number of bits representing the decimal number is also how much points scored for the particular line. Demo On Youtube Bintris About The Implementation The game is developed in Go and is implemented using OpenGL (graphics) and OpenAL (sound). Gomobile is used to generate shared libraries that are used for the Android build. The game works just as good on Linux as on Android. It all started as an experiment with Gomobile and ended up as a fully working game, after a lot of frustration and gotchas! ;) With that said, the source is a bit of a mess and I have some stuff on my todo-list such as implementing full parsing of wav header, a simple FSM for the game etc. Building From Source To just run the game on Linux, just issue the command: go run . Build For Android First make sure you have built OpenAL (make openal). It's a bit complicated to make the OpenAL build work succesfully with current state of gomobile. I've added some notes below about this. make android Build For Android Studio The repository includes a very small Android Studio project that is used to build AAB package format for Google PlayStore. This project handles AAB packaging and uses the shared objects (.so) files from the build. To build/run via Android Studio (make sure to have OpenAL libraries first make openal, see requirements below): 1. make studio 2. Open the project in Android Studio 3. Attach mobile or virtual device and run. Details OpenAL Update toolchain.cmake to use -O3 -s to build smaller version of OpenAL (otherwise you will end up with ~30MB debug none stripped version) Also update to armv8 (line 578) in the toolchain from v7. Using AAB packaging for PlayStore requires libraries loaded with dlopen to not use the path. Hence, the audio/al packages requires to just use dlopen("libopenal.so"). The base.apk in aab doesn't include the libraries rather they are included in the split_config. .apk. AL/openal.h etc requires to be in audio/al package dir for rebuilding: exp/audio/al/al_android.go:17 // All other code for reading ENV can be removed. *handle = dlopen("libopenal.so", RTLD_LAZY); Build OpenAL: make openal Go Use `ldflags="-w" to remove debug information from the build (see Makefile) Changes Required to Gomobile Command Line 182 in mobile/cmd/init.go: cmd := exec.Command(cmake, "-S", initOpenAL, "-DANDROID_PLATFORM=23", "-B", buildDir, "-DCMAKE_TOOLCHAIN_FILE="+ndkRoot+"/build/cmake/android.toolchain.cmake", "-DANDROID_HOST_TAG="+t.ClangPrefix()) ADB Debug View logs from connected phone (developer mode): adb logs Debug using: adb shell pm list packages -f |grep bintris Then download: adb pull Too see what is included in the divided apk's. License GNU General Public License v3.0 (see COPYING) About Binary Tetris Topics android game go golang mobile opengl openal mobile-game gomobile Resources Readme License GPL-3.0 License Stars 40 stars Watchers 3 watching Forks 0 forks Releases No releases published Packages 0 No packages published Languages * Go 94.1% * Java 3.8% * Makefile 2.1% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.