Giter Site home page Giter Site logo

micabytes / mica-android Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 11.0 4.77 MB

A simple Android library project containing convenience classes and functionality for building low complexity 2D games using the native Android classes.

License: Apache License 2.0

Java 1.74% Kotlin 98.26%

mica-android's Introduction

This project is no longer being maintained.

---

The MicaBytes Game Library (micabytes/lib_game) is an Android library that
encapsulates some of the logic required for creating a simple 2D game using
the native Android graphics library.

This might be useful to you if:

* You want a simple 2D graphics library for Android, and you don't need any
flashy effects. It doesn't get much simpler than Canvas.drawBitmap(...) and
the Canvas is plenty fast enough for graphics that are not heavy on animation.

* You want to combine 2D graphics with native Android UI elements. For
whatever reason, almost all game frameworks refuse to use the native Android
UI, which makes building complex UIs a chore.

* You want to do 2D graphics using SurfaceView in Android, but haven't found
any good examples to work with.

You won't find this useful if you are looking to build 3D graphics or need
lots of animation. For those kind of demands, I recommend taking a look at
an OpenGL framework; e.g., libGDX.

It is released under the Apache 2.0 license. 

If you do bug fixes, improvements or extensions, please consider contributing
them back to the library to be incorporated in future iterations.


Usage:

The current project setup is built for Android Studio, and utilizes a number of
base libraries that I find useful.

   * Jackson: for effective JSON decoding
   * Google Play Services: For all the extra Google Play functionality such as
   cloud-saves, etc.
   * Fabric: Currently the best crash-reporting tool for Android.

Main Components:

* ImageHandler: This is a standard singleton class image cache using
SoftReferences. Useful to manage bitmaps.

* MusicHandler: A very simple static class to manage playback of music. Needs
more work.

* StringHandler: A simple class that allows for some string manipulation.

* MicaSurfaceView: A SurfaceView implementation based on the "standard"
render thread format, with pan, fling, and pinch-zoom support implemented.

* BitmapSurfaceRenderer: Rendering implementation for GameSurfaceView.
Allows for the handling of very large bitmaps (larger than available
memory) as backgrounds. 

* TileMapSurfaceRenderer: Rendering implementation for GameSurfaceView that
handles a simple TileMap of squares.


Example code:

The old example project can also be found on github, but it is no longer
up to date:
https://github.com/micabyte/android_game_example


Limitations:

The library requires Android 2.3.3 or better. The reason for this is entirely
due to the use of BitmapRegionDecoder. Remove that, and the library should be
compatible down to Android 1.6.

Also, note that while the library builds upon code from my previous projects
and I use it in my current development, this particular version of the library
has not yet stood the "test of fire" from tens of thousands of devices. There
may still be many subtle (and not so subtle) bugs in the code.


Integrating lib_base in another Android Project

1. From your projects root directory (assuming it is version controlled in Git), run:
> git submodule add [email protected]:micabytes/lib_game.git

2. In settings.gradle, add:
include ':lib_base'

Then sync the project, and make sure to add a dependency on lib_base in the core project file.


mica-android's People

Contributors

michaeloa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mica-android's Issues

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.