Looking to get into sprite-based 2D game programming

Started by
9 comments, last by Shawn Myers 11 years ago

I do not know much about the subject, but from what I can tell that bear fighting game I linked appears to be straight 2D without anything 3D-accelerated.

Given that Fist of Awesome runs on OUYA, iOS, and Android, it's safe to assume that everything is rendered using OpenGL ES. You can't (visually) tell the difference between drawing the individual pixels using something like GDI+ vs drawing textured quads using OGL or DX. They look exactly the same. Either one can be 'purely 2D.' It's just a matter of setting up the states/shaders to get things to look they way you want it. Take the below screenshot from a game a friend and I worked on for example:

MainScreen.jpg

Everything is drawn using DirectX 9 (to be more accurate, it uses a wrapper around it called XNA.) Basically you create a bunch of textured squares ( called quads ) send those to the GPU and they pop up on the screen. The projection matrices are set up so that everything is projected into 2D space; there is no 3D.

So, OGL and DX are not 3D specific. They are more like this generic blob that can do whatever you ask them to do (more or less.) You want 2D? Great, build yourself a shader and set up the correct matrices and you got it. 3D? Same story, create your shaders, set you states, read a couple math books and you are good to go.

This topic is closed to new replies.

Advertisement