as a title how to start creating android games? Is there any sample code for android games creation , what graphic library used ?
Thanks.
as a title how to start creating android games? Is there any sample code for android games creation , what graphic library used ?
Thanks.
There are basically two graphics systems for Android. Canvas
, which is not hardware accelerated (all stuff is done by the CPU).
The more powerful and hardware accelerated alternative (if you're using it correctly) system is OpenGL
. Google has done a very good work on wrapping the OpenGL
system into one basic view, which is GLSurfaceView
.
However, you should start looking at the Sample API demos, where the Lunar Lander demo is a great start. If you're already going hardcore and want to learn about the OpenGL
system, the SpriteMethodTest is a good start, created by Chris Pruett, which also has done an open source project called Replica Island.
If you're intersted in some other resources about games, see:
Android graphics overview: http://developer.android.com/guide/topics/graphics/index.html
3d graphics intro: http://developer.android.com/guide/topics/graphics/opengl.html
2d graphics intro: http://developer.android.com/guide/topics/graphics/2d-graphics.html
As for general gaming development, you should read up on fundamentals before trying to make games on it. It is quite different to program on mobile platforms. http://developer.android.com/guide/topics/fundamentals.html
A couple game examples:
JetBoy: http://developer.android.com/resources/samples/JetBoy/index.html
LunarLander: http://developer.android.com/resources/samples/LunarLander/index.html
Snake: http://developer.android.com/resources/samples/Snake/index.html
It's kind of a vague question, since there is everything from word games to first-person shooter games. Have you looked at the Lunar Lander sample project?
You can use the Canvas provided by the method onDraw of an View to draw 2D graphics. Sometimes it's enough for an game.
You can also use OpenGL ES to hardware accelerated drawing.
It sounds to me like you're looking for something more like App Inventor which abstracts a ton of programming for the creator at the cost of flexibility.
Well... I was also very keen to making android games as a hobbist.... as I proceed with my research... I found that there are many nice open frameworks available for this purpose, I highly recommend LibGDX for making android games. This is mostly java based but ports your game for Desktop, Android as well as iOS.