Search code examples
androidgraphicsopengl-es2dandroid-canvas

Android 2D-game, best choice for graphics?


We are 2 guys without experience in Android development and 2D-games.

We want to make a 2D game with fairly simple graphics for Android phones. It is basically a city seen from above. Buildings would just be rectangles. Then we will have simple characters as small circles. We need to continously update the screen. There will be some AI(pathfinding and collisiondetection).

What would be the best way to do the graphics? What are the pros and cons of OpenGL, Canvas and Graphics? Maybe canvas is slower but easier to use than OpenGL. Maybe 2 people without experience can make a better game with Canvas or Graphics than with OpenGL even though OpenGL has more potential? We have roughly one month of full working days to put in.

We have an idea to use google maps as well, then I guess that would be a bitmap. Does that change things?

We will program in Java.


Solution

  • Sounds like you are going to want to use SurfaceView and implement your own game loop. It is pretty easy to get up and running. You may also want to check out a game engine such as AndEngine or LibGDX.

    AndEngine and LibGDX handle all of the set-up work for you and they are pretty nice to use. LibGDX is my favorite as it allows for more lower level access and I have found has better performance. And allows you to do all of your testing right on your computer and deploy to the device only when you need to.

    If you aren't that familiar with OpenGL then it will definitely have a learning curve and I think you will spend the majority of your time learning it rather than jumping right and making something. If all you need is 2D then SurfaceView will be more than enough based on your description. You can do all of your collision detection with bounding rectangles which is super easy in Android.