Coding Environment (Android) - efroemling/ballistica GitHub Wiki

Overview

This page will help you to Set up Coding Environment on Android. You can create, compile, debug, and format your mods in this environment. You will also be able to use computer-like IDE on your Device.

Note: This isn't the info of how to 'make prefab' for Android.

Requirements

  • Little knowledge of using Linux cd command.
  • You have to install:
    1. Pydroid 3,
    2. Pydroid Repository Plugin,

Setup Steps

Step 1

  • Download BombSquad apk or alternatively BombSquad Windows zip from here.
  • Change the file extension of BombSquad apk to .zip and then extract it.
  • Now go to assets/ballistica_files/ba_data and copy folder python-site-packages, data, and python to a New folder(Let us suppose the name Foo) where you want your Workspace for mods.

Step 2

  • Open Foo and move all the contents of python-site-packages to folder python and delete folder python-site-packages.
  • Now open the Ballistica Repo and download _ba.py .
  • Open Downloads folder and copy _ba.py to the python folder which is there in Foo Folder.

Here we have downloaded _ba.py, which is a dummy module. The actual real _ba.py exists inside the game. Without having the dummy _ba.py in our python folder, our IDEs would not work and give errors. Nutshell: It helps our IDEs to work properly while compiling scripts.

Step 3

  • Open Pydroid 3 Terminal Window.
  • Type pip install pylib yapf and press Enter.
  • After both are installed you can exit Pydroid 3.

Here we have downloaded all the necessary packages to work with compiling of scripts.

If you have experience with Pycharm or any other IDE, and want to use computer-like IDEs on your Device, continue to follow the following steps.

Step 4

  • Open Pydroid Terminal and type pip install jupyterlab ipynb-py-convert.

Here we have installed our IDE called JupyterLab and have downloaded necessary packages.

Now your Setup is Ready for Coding.

Coding in IDE

Pydroid 3

You can code and run the script in this IDE itself. It also has dark mode.

JupyterLab

To use Jupyter Lab you will need to do the following steps.

  • Open Pydroid 3 Terminal and type jupyter lab. A Chrome page will open. Chooose desktop site on Chrome. This page will be your IDE.
  • Now navigate to your workspace.

Note: If you are going to use existing file, first go to your Workspace where file is present using cd in terminal and type ipynb-py-convert <filename>.py <filename>.ipynb (This is to be done because this IDE can only open .ipynb files. No code data will be lost) Else you can create a new file in JupyterLab.

  • After editing code, you can compile and run the code.
  • After Saving the file, you will need to convert the file back to .py. To do that, go to your workspace where file is present using cd in Pydroid Terminal. Type ipynb-py-convert <filename>.ipynb <filename>.py
  • After this remove the starting and ending modulus(%) sign in your code file.

JupyterLab also has dark theme.

Now it depends on you which IDE to use. If you are familiar with computer IDEs, go with JupyterLab which will give you a good experience. Else you can use Pydroid 3.

Compilation and Debugging

Pydroid 3

Once you have written your code, move your file to Foo/python. Open your file in Pydroid 3 and click on Run/Play Button.

JupyterLab

On JupyterLab, you can tap on the Run button in the Top Bar.

Formatting code

Follow the Coding Style Guide.

To automatically format your code to PEP8, open Terminal in Pydroid 3. Use cd to go to the folder where script is (Foo/python).

After this, type yapf -i <filename>

Doubts

For any doubts, Contact me(Benefit-Zebra).

⚠️ **GitHub.com Fallback** ⚠️