Soham Chowdhury
Soham Chowdhury

Reputation: 2265

Canvas or OpenGL ES2 for Android 2D game?

OK, so I just got this idea for a game. I already know how to develop for Android, so I though of developing for Android first.

The game (without revealing too much :D) will have a single shape onscreen all the time. It will have to smoothly change shape, color etc. in response to a few knobs/sliders on the screen.

As we do not have multiple shapes/objects I do not need any form of physics engine now. I need to be able to draw polygons and transition colors/gradients effortlessly. I'm targeting a high FPS for this game (think PewPew/2Fuse!)

Do I need OpenGL for this? If so, where can I learn it? (I'm aware that OpenGL is difficult, and that it's time-consuming to learn.)

Upvotes: 2

Views: 4918

Answers (2)

HalR
HalR

Reputation: 11073

If your assets are polygon based (as you mention in a comment) you should go with OpenGL ES 2.0. OpenGL ES 2.0 is non-trivial to learn, but in learning it, you would gain some marketable skills and experience, and you could make work that is very "showy" for a programmer. Just be patient and try to understand how it works and not just "slop through it."

A great place to start learning is with a tutorial like this one.

Upvotes: 1

user1095108
user1095108

Reputation: 14603

I can only offer some of my views. Programming a game is much about transferring artistic assets from the programs, in which they are created (3D modeling programs, Photoshop, Gimp, ...), into your own program. Whether you select OpenGL or Canvas is therefore somewhat dependent upon the nature of your assets (3D models, or bitmaps only, for example). You should be aware however, that on modern Android devices OpenGL ES support is universal and that on those devices the Canvas is implemented with OpenGL ES. Choosing OpenGL ES therefore eliminates one level of indirection. You also have libraries like Cocos2D that offer 2D APIs, but use OpenGL for implementation. To conclude, without top-notch artistic assets your game cannot succeed, if those are good however, even a game using the Canvas may succeed.

EDIT: I think you should proceed like this:

game design -> assets implementing game design -> API offering the shortest path towards the reproduction of the assets in your game

Upvotes: 4

Related Questions