Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Simple Android App (2014) Creating the Screen Layout Getting to Know Our Tools

Shaun Kelly
Shaun Kelly
5,648 Points

Is Android studio good for creating basic video game apps such as Flappy Bird, Brick Jump, Timber man etc?

I am wanting to build and create games with Android.

4 Answers

I have done a little bit of work with android game development. Most of the tools and components build into the standard android sdk are best for laying out applications though there are lot of tools that can be used to build custom views. You can hack them to work and build some simple android platform games. There are a lot new animation functions that would help to. I think the android sdk has some examples of simple games.

WHen you start to get more sprites and and complex game logic (such as gravity) it really helps to use a library as coding all that stuff can take as much time as the game itself. While they can be complex and take a bit to learn they offer a lot of tools for game development.

As far as android studio, It is new so most libraries are not built around it yet but everyone in currently in the process of switching so you can start find help and libraries for it and most libraries can be imported in. But it has most the development tools you need to build most 2d games.

A very popular and free library I recommend is libGDX http://libgdx.badlogicgames.com/ It will give you everything you need for a 2d/2.5d game.

Let me know if you have any more questions.

Andrew VanVlack

Shaun Kelly
Shaun Kelly
5,648 Points

Thats great I have a bit better understanding of things now, thanks. I am very new to coding and all the software's used for learning stuff in Treehouse such as Android Studio. I have never heard of Libgdx and i'm trying to understand what it is. So you are saying that I can get tools and sprites from Libgdx that can be imported into Android Studio to create games, correct?

So a library is a bunch of code that allows you to more easily create the logic that you need for your game. Also as games are take a lot of system resources these items need to be programmed very efficiently. So say your game is a mario type game you need a few things in creating it:

Sprites - these are all the image items like the character and the platforms. There is going to be a lot of image and you need some way to manage them and display them in the right spot on the screen. Then a way to animate them.

collision detection - You want your character to not fall through the floor and be able to jump on platforms.

Gravity - When your character jumps or falls you want it to come back to the ground. Gravity can be a complex thing to code.

This is just a small list of what you need in building a game and goes on to things like audio and character controller. Libgdx has the code snippets to help you get those things done. You then take those elements, customize them to your needs, add your own and there you have it. If you follow along on the android track you will use some different libraries in your apps and that will show you how to use libraries in general.

Shaun Kelly
Shaun Kelly
5,648 Points

Thats making a lot more sense but I don't think it's answered my question completely. Can I create or import sprites, collision detection, gravity and other things for my game in Android Studio ?

So Android studio is mainly for directly coding applications. It will help you write, organize, compile, and debug your code but it is not a full game development environment like unity 3d. Sprites will have to be made in something like photoshop/illustrator/gimp/inkscape you will then have to import the sprite into android studio and through code, lay it out. There are tools to help lay things out but android studio does not have visual layout editor like you would find in unity. Something like collision detection will have to be programed (with the help of libraries).

Shaun Kelly
Shaun Kelly
5,648 Points

Where can I get a library from Unity to import into Android studio ??

Unity 3d is its own integrated development environment (ide), so you build the whole game inside of it and then it will spit out an apk to run on android (or files for iOS, windows, and a host of other platforms). It is a very powerful development environment but you will not be using Android studio and java to do most of the work. Insted, unity uses javascript or C# (or boo but it is not recommended as it is not very popular which comes with less information on it.) inside its on application as its languages to program. It is also a visual editor so all the visual items you can drag and drop and the code all the logic for the items. Treehouse has courses on javascript that will get you started but then you will have to dive into the unity documentation as it will be quite different working with web javascript vs. unity javascript (unityscript).