💀 💀 💀 s k u l l s 💀 💀 💀 https://github.com/rootVIII/skulls
Find a file
2021-05-29 22:20:48 -04:00
assets skulls! 2021-05-24 23:21:01 -04:00
skullsebitenbind mv ebiten.RunGame to prevent ebitenbind goseq issue 2021-05-29 22:07:49 -04:00
skullsgomobile mv ebiten.RunGame to prevent ebitenbind goseq issue 2021-05-29 22:07:49 -04:00
.gitignore gitignore 2021-05-29 22:05:37 -04:00
go.mod skulls! 2021-05-24 23:21:01 -04:00
go.sum skulls! 2021-05-24 23:21:01 -04:00
LICENSE Create LICENSE 2021-05-28 16:49:36 -04:00
README.md readme 2021-05-29 22:20:48 -04:00
skulls.go mv ebiten.RunGame to prevent ebitenbind goseq issue 2021-05-29 22:07:49 -04:00

Skulls is simple Columns-like strategy game developed in Golang with the Ebiten library (for Android)

ex2
gomobile, build .apk for development and testing:
  
// Navigate to skulls/ and generate a .apk with skullsgomobile/:
gomobile build -target=android github.com/rootVIII/skulls/skullsgomobile

// Install the newly created .apk into an already running Android Emulator (from Android Studio):
adb -s emulator-5554  install skullsgomobile.apk

// view logging output from the game:
adb logcat

// Note that I use a pixel4 emulator. I have an alias stored in my profile to open it easily via terminal:
alias pixel4='$ANDROID_HOME/emulator/emulator -avd "Pixel_4_API_30"'
  
ebitenmobile, build .aar for Android Studio binding:
  
// Navigate to skulls/ and generate the .aar binding:
ebitenmobile bind -target android -javapkg com.<your-username>.skulls -o skulls.aar github.com/rootVIII/skulls/skullsebitenbind

// Import the new .aar as a module
// in app/src/main/java/<your username>/MainActivity.java place the following:

package com.<your-username>.skullsmobile;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import go.Seq;
import com.<your-username>.skulls.skullsebitenbind.EbitenView;


public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Seq.setContext(getApplicationContext());
    }

    private EbitenView getEbitenView() {
        return (EbitenView)this.findViewById(R.id.ebitenview);
    }

    @Override
    protected void onPause() {
        super.onPause();
        this.getEbitenView().suspendGame();
    }

    @Override
    protected void onResume() {
        super.onResume();
        this.getEbitenView().resumeGame();
    }
}

// add a separate error handling class in app/src/main/java/<your username>/EbitenViewWithErrorHandling.java
package com.solsticenet.skullsmobile;

import android.content.Context;
import android.util.AttributeSet;

import com.<your-username>.skulls.skullsebitenbind.EbitenView;


class EbitenViewWithErrorHandling extends EbitenView {
    public EbitenViewWithErrorHandling(Context context) {
        super(context);
    }

    public EbitenViewWithErrorHandling(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    @Override
    protected void onErrorOnGameUpdate(Exception e) {
        // You can define your own error handling e.g., using Crashlytics.
        // e.g., Crashlytics.logException(e);
        super.onErrorOnGameUpdate(e);
    }
}


// Add the below into app/src/main/res/AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.<your-username>.skullsmobile">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.SkullsMobile">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

  
  • All development/debugging was done with the gomobile tool and adb.
  • Font used for text: RADIOLAND.TTF
  • All assets (images, audio, and font) were converted to []byte using file2byteslice

This was developed on macOS Big Sur.


Author: rootVIII 2021