OpenGL ES 2D game famework

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

OpenGL ES 2D game famework

Postby jptsetung » Sun Aug 16, 2009 6:48 pm

Hello,

I would like to make a game for Android, but OpenGL ES scares me.

I've been looking for a 2D game library for android for about 4 hours now and I can't find anything. There is really a need for this, I'm surprised nobody started such a project. Unless I didn't find it...
jptsetung
Freshman
Freshman
 
Posts: 2
Joined: Sun Aug 16, 2009 6:11 pm

Top

Postby WarrenFaith » Mon Aug 17, 2009 1:50 pm

Maybe you could start by learning the fundamentals about 2d programming on android.

You could start here and build your own library. MrSnowFlake did a library, never tested it :)

http://www.droidnova.com/playing-with-g ... i,147.html
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby jptsetung » Mon Aug 17, 2009 2:34 pm

Thank you WarrenFaith, I didn't find the library you were talking about on this page. [edit]I've found it now.
We are all building our own library whereas we could capitalize to make a great opensource library like it has been done on the iPhone (cocos2D). The android market place would get more and better 2D games with a great library available.
jptsetung
Freshman
Freshman
 
Posts: 2
Joined: Sun Aug 16, 2009 6:11 pm

Postby WarrenFaith » Mon Aug 17, 2009 3:14 pm

so feel free to start one....
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby Superted » Mon Aug 17, 2009 3:27 pm

WarrenFaith wrote:so feel free to start one....

:D
Superted
Junior Developer
Junior Developer
 
Posts: 16
Joined: Sun Jun 14, 2009 12:46 pm
Location: The Netherlands

Postby Frink » Fri Sep 11, 2009 11:31 pm

I'm currently working on an open source opengl 2d framework, trying to make it as easy to use and extensible as it can be.

Not promising it will be perfect, far from it, but I hope it will give the android gaming developers a bit of a boot in the ass. Should have something released soon :)
Last edited by Frink on Fri Sep 18, 2009 4:39 pm, edited 1 time in total.
User avatar
Frink
Developer
Developer
 
Posts: 46
Joined: Sat Aug 15, 2009 7:42 pm

Top

Postby _Auron_ » Sat Sep 12, 2009 1:15 am

I actually developed a rather versatile and very easy to use 2D Game Engine using OpenGL while developing my game, Stroids. To have a public release it would need some polishing off and some fixes here and there, but check out Stroids to see what it's capable of. Currently I'm about to finish a super fast Tilemapper that gets 50-60FPS for a fullscreen 8-way scrolling tilemapper with size 32x32 tiles (that's 15x10 tiles onscreen for a total of 150+ tiles; more than 150 due to new offset tiles when scrolling).

Things I need to work on are dynamic allocation for objects; right now you have to assign how many objects and textures you're going to create before Image.init() is called, where you throw in the commands to generate everything. Image.init() is called in onSurfaceCreated() and onSurfaceChanged() in the GLSurfaceView. In this you load a texture:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. atlas = new imgData( gl, context, texture, R.drawable.atlas );
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Then you load a sprite object:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. tank = new Sprite( atlas, 0.0f, 0.0f, 32.0f, 32.0f, 32.0f, 32.0f );
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

Parameters are imgData, texX, texY, texWidth, texHeight, spriteWidth, spriteHeight. This allows for multiple images to be stored in the same texture (called an Atlas Texture), so you can use spritesheets or whatever you fancy for maximum efficiency. My engine also supports the use of multiple textures, though this implementation hasn't been polished yet.

Then, when you want to draw that object, you just call Entity.draw(Sprite, X, Y); It also includes overloaded methods with extra parameters for rotation, scale, and RGBA values.

Furthermore if you want to have a series of similar objects, you can implement the Entity class and work from there. That's what I did with Stroids; I made Bullet, Particle, Enemy, and Grid (for the background effect) implement Entity, then use custom drawing and construction methods.

Not only have I coded all of that in, but I have quick and easy sound object control using SoundPool (although there's a lifecycle bug with it that I can't figure out yet), and easy drawing of custom bitmap Text using Text.draw(String, X, Y) with overloaded methods that have scale and RGBA parameters.

And of course, I'm about to finish my tilemapper to add to the engine. I haven't worked in music support yet since Stroids was too intensive to allow the extra processing for music, but I'll add in support later.

I'm iffy about releasing this to the public as of right now, since I'm trying to start a new mobile game company for Android, but I may release soon anyhow. We'll see.
_Auron_
Freshman
Freshman
 
Posts: 9
Joined: Fri Jul 10, 2009 7:50 am

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests