Bintris - a mobile game developed in Go

🎮 Bintris

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 commands:

# First remove line for modified version of gomobile
sed -i '/nergal/d' go.mod
# Then run the game
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)

Owner
Magnus
Spare-time Indie Game Developer and Voxel Enthusiast!
Magnus
Similar Resources

Mobile Money API Handyman

pesakit pesakit is a highly configurable commandline tool that comes in handy during testing and development of systems that integrate with mobile mon

Nov 22, 2021

A Declarative Cloud Firewall Reverse Proxy Solution with Companion Mobile App

A Declarative Cloud Firewall Reverse Proxy Solution with Companion Mobile App

A declarative Cloud firewall reverse proxy solution with inbuilt DDoS protection and alerting mechanism to protect your servers and keeping an eye on those malicious requests

Aug 10, 2022

Building block for mobile money api clients

base the base code for creating mobile money api clients using golang build request request := NewRequestBuilder("login request", http.MethodPost, "ht

Jan 4, 2022

MTN Mobile Money API Client in Go

mtnmomo-go This package provides a generic go client template for the MTN Mobile Money API Installation mtnmomo-go is compatible with modern Go releas

Dec 27, 2022

A mobile security hash generator using golang

Mobile Security Hash Generator Project scope This little script is my first experiment using Go. I wrote it for my friend @marcotrumpet because he nee

Oct 10, 2022

Iran National Id, Bank Card Number, Mobile Number Validator for golang

Iran IDValidator Iran National Id, Bank Card Number, Mobile Number Validator for golang Installation go get -u github.com/mohammadv184/idvalidator Us

Dec 20, 2021

Built in user interface, LAN file transfer, such as mobile phone, computer, tablet, different operating system

Built in user interface, LAN file transfer, such as mobile phone, computer, tablet, different operating system

Modao Built in user interface, LAN file transfer, such as mobile phone, computer, tablet, different operating systems, etc., as well as text transfer

May 7, 2022

Magma: Gives network operators an open, flexible and extendable mobile core network solution

Magma: Gives network operators an open, flexible and extendable mobile core network solution

Connecting the Next Billion People Magma is an open-source software platform tha

Dec 24, 2021

The Bhojpur MDM is a software-as-a-service product used as a Mobile Device Manager based on Bhojpur.NET Platform for application delivery.

Bhojpur MDM - Mobile Device Manager The Bhojpur MDM is a software-as-a-service product used as a Mobile Device Manager based on Bhojpur.NET Platform f

Dec 31, 2021

Arkanoid game in Go using Ebiten game engine with ECS.

Arkanoid game in Go using Ebiten game engine with ECS.

Arkanoid-go Arkanoid game in Go using Ebiten game engine with ECS. You must have Git LFS installed when cloning the repository to download assets. See

Oct 9, 2022

AircraftWar - a game powered by Go+ spx game engine

AircraftWar - a game powered by Go+ spx game engine

AircraftWar - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download thi

Jan 5, 2022

FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022

FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022

MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this g

Dec 16, 2021

A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

galactic-asteroid-belt Overview A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy! Run To run, you will need Go

Dec 2, 2021

RundQuiz-Game - This is a Go exercise that implements and builds a quiz game from a list of math questions in a CSV file.

Go RundQuiz Game Exercise details This exercise is broken into two parts to help simplify the process of explaining it as well as to make it easier to

Jan 5, 2022

Simple 2D game to teach myself various things about game development and ECS, etc

2d-grass-game I really don't know what to name this game. Its a big grass field, and its in 2d so....2D Grass game This is a simple 2D game to teach m

Jan 17, 2022

Lobby - A Nox game lobby which exposes a simple HTTP API for both listing and registering Nox game servers

Nox lobby server This project provides a Nox game lobby which exposes a simple H

Mar 6, 2022

Wprecon, is a vulnerability recognition tool in CMS Wordpress, 100% developed in Go.

Wprecon, is a vulnerability recognition tool in CMS Wordpress, 100% developed in Go.

WPrecon (Wordpress Recon) Hello! Welcome. Wprecon (Wordpress Recon), is a vulnerability recognition tool in CMS Wordpress, 100% developed in Go. Featu

Dec 25, 2022
Comments
  • Problem with absolute path

    Problem with absolute path

    When i try to run game from linux by go run . i receive error with absolute path

    I think it's that commit c0d19f075a877e0c6da396358002f1fca037d0dc

    go run .
    go: golang.org/x/[email protected] (replaced by /home/nergal/go/src/golang.org/x/mobile): reading /home/nergal/go/src/golang.org/x/mobile/go.mod: open /home/nergal/go/src/golang.org/x/mobile/go.mod: no such file or directory
    go: golang.org/x/[email protected] (replaced by /home/nergal/go/src/golang.org/x/mobile): reading /home/nergal/go/src/golang.org/x/mobile/go.mod: open /home/nergal/go/src/golang.org/x/mobile/go.mod: no such file or directory
    
  • Play Store Data Safety Section

    Play Store Data Safety Section

    Hi Team

    In the recent Play Store policy, it will become mandatory for you to fill out the Data Safety Section. Since this is an OSS Android app, it will make sense to have it as a part of the repository as well.

    I have run the scan using my tool here on your repo, attached are the scan results. I found the following 1 data type & 0 SDK.

    If this is helpful, do use our free tool to generate Play Store Data Safety report: https://github.com/Privado-Inc/privado

    Also, do share your feedback & thanks for the OSS app 😄 image image

Gorched is terminal based game written in Go inspired by "The Mother of all games" Scorched Earth

Gorched Gorched is terminal based game written in Go inspired by "The Mother of all games" Scorched Earth. How the game looks like depends on your ter

Dec 13, 2022
MNA - stands for mobile number assignment - a small zero external dependency golang library that is used to identify mobile number assignment in tanzania

MNA - stands for mobile number assignment - a small zero external dependency golang library that is used to identify mobile number assignment in tanzania

Nov 29, 2021
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.

Beaver A Real Time Messaging Server. Beaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime

Jan 1, 2023
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.

Homepage Download Blog/News @uniqush Introduction Uniqush (\ˈyü-nə-ku̇sh\ "uni" pronounced as in "unified", and "qush" pronounced as in "cushion") is

Jan 9, 2023
Mobile Blogging System

Mobile Blogging System

Mar 3, 2022
A collection of cool tools used by Mobile hackers. Happy hacking , Happy bug-hunting
A collection of cool tools used by Mobile hackers. Happy hacking , Happy bug-hunting

A collection of cool tools used by Mobile hackers. Happy hacking , Happy bug-hunting Family project Table of Contents Weapons Contribute Thanks to con

Jan 3, 2023
:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.
:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.

$ qrcp Transfer files over Wi-Fi from your computer to a mobile device by scanning a QR code without leaving the terminal. You can support development

Dec 28, 2022
[mirror] Go on Mobile
[mirror] Go on Mobile

Go support for Mobile devices The Go mobile repository holds packages and build tools for using Go on mobile platforms. Package documentation as a sta

Jan 3, 2023
Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.
Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Connecting the Next Billion People Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core

Dec 31, 2022
HTML Canvas 2D Context API for mobile, desktop and web

canvas HTML Canvas 2D Context API for mobile, desktop and web Context2D API https://www.w3.org/TR/2dcontext/ native code implement https://github.com/

Apr 22, 2022