0

I'm planning on making a 2D game for Android. For drawing custom graphics, Android Training only goes over how to do so with OpenGL. For my first Android game, I don't want to have to learn OpenGL if I don't need to.

While programming games for Desktop with Java it's simple to paint images and draw. But OpenGL seems to be the standard for Android.

So my questions are, is OpenGL necessary or are there other options? Do I need to use an API or can I just use Android's basic toolkit? It's not possible to use Java's swing with Android, right?

4
  • These open ended questions aren't good for StackOverflow since you didn't mention what type of 2D game you are trying to do (and perhaps what would be the second or third game). Something simple like a Lunar Lander clone, Android Canvas will work. Something like a 2D scrolling platform - dedicated game engines or Java with OpenGL would be more appropriate. Commented Aug 5, 2017 at 3:31
  • Thanks, I was planning on doing something similar to a Side Scroller for my first project so I guess, as you advise, I will suck it up learn OpenGL. Commented Aug 5, 2017 at 3:47
  • If you are familiar with Java - suggest you watch this old Google IO video on Real Time Games: youtu.be/U4Bk5rmIpic and youtu.be/7-62tRHLcHk and then look at third-party engines if you want to focus on game development. Commented Aug 5, 2017 at 3:52
  • @MorrisonChang Thanks, I liked the parts in those talks about game architecture and marketing. Commented Aug 6, 2017 at 19:48

1 Answer 1

1

Android GUI is like Swing, it’s on a single thread, if you do some heavy lifting on that thread it will cause some issue’s just like with Swing. There are mechanisms and classes available that like SwingWorker help you out. But If you wanna work in C++ it would be best to use OpenGL library for it.

Determining which engine is most suitable for your game project is a significant design choice, so you'll want to do your homework. Engines with more features are generally bigger and more complex to use than smaller, lightweight engines. Some game engines focus on cross platform support with a single code base. In this case, the developer usually writes their games in some sort of scripting language. Other game engines will require native coding on each platform.

There are alot of new technologies present now on Game Development for Android even you can use Third Party Game Engines. For e.g,

Android Box2D - This is 2D physics engine written in C++ for Android developers which has even won some awards. Used to create the Crayon Physics Deluxe game, and ports for other platforms are available.

Cocos2D-x is One of the strongest and most famous free-to-use frameworks for building 2D games on both platforms (for Android & IOS).

I hope =my answer would help you.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.