Git Product home page Git Product logo

rapt-pygame-example's Introduction

RAPT Pygame Example

This serves as an example of how to get a simple Pygame game working on Android.

Step 0: Ready the game.

Please ensure that the main file of your game is named main.py.

Please ensure that your game will run with pygame_sdl2. Generally, this consists of adding the lines:

try:
    import pygame_sdl2
    pygame_sdl2.import_as_pygame()
except ImportError:
    pass

to the top of your main.py file, before the first import of pygame. (However, note that pygame_sdl2 does not yet implement all of pygame.)

For now, RAPT supports only python2.7.

This repository serves as a simple pygame_sdl2-ready game.

Step 1: Install dependencies.

RAPT depends on your computer having a JDK in the path, and Python 2.7 installed. On Windows, you'll need a 32-bit JDK if you're using a 32-bit Python 2.7.

You may also need to install device drivers and permissions to ensure that the Android SDK will talk to your device.

Step 2: Download and unzip RAPT.

Download the latest nightly build of RAPT from http://nightly.renpy.org/current/ . The file you want will end in -rapt.zip. Unzip the file. All further commands should be run from inside the rapt directory.

Step 3: Install the Android SDK.

This can be done by running:

python android.py installsdk

RAPT will prompt you to accept various license, and create a signing key. This has to be done only once per RAPT install.

Step 4: Configure the game.

Configure the game:

python android.py configure /path/to/rapt-pygame-example

The correct answers vary depending on the game. For our example, we used:

  • Full Name: Android Test
  • Short Name: Android Test
  • Package Name: org.renpy.android_test
  • Human-readable Version: 1.0
  • Version Code: 100
  • Orientation: 1) Landscape
  • Expansion APK: 1) No
  • Android Version: 3) Android 4.0
  • Application Layout: 1) Single directory, device internal storage.
  • Include Source Code: no
  • Permissions: VIBRATE
  • SQlite3: no (may not work)
  • PIL: no (may not work)

This must be done once per game.

Step 5: Build, Install, and Run the game.

This can be done with the command:

python android.py --launch build /path/to/rapt-pygame-example release install

This must be done each time the game changes, to ensure the latest version is on the device.

rapt-pygame-example's People

Contributors

renpytom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.