Some of you have been curious about what the air hockey game from the book would be like if we brought it over to other platforms. I would like to find out, myself. 🙂 In the spirit of my last post about cross-platform development, I want to port the air hockey project over to a native cross-platform code base that can be built for Android and iOS, and even the web by using emscripten and WebGL. Everything will be open-source and available on GitHub.
Here are some of the things that we’ll have to figure out and learn along the way:
- Setting up a simple build system for each platform.
- Initializing OpenGL.
- Adding support for basic touch and collision detection.
In the next post, we’ll take a look at setting up a simple build system to initialize OpenGL across these different platforms. Here are all of the posts for the series so far:
Setting up a simple build system
- Calling OpenGL from C on Android by using the NDK
- Calling OpenGL from C on iOS, Sharing Common Code with Android
- Calling OpenGL from C on the Web by Using Emscripten, Sharing Common Code with Android and iOS
Adding support for PNG loading into a texture
- Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2, Using (Almost) the Same Code on iOS, Android, and Emscripten
- Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2: Adding Support for iOS
- Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2: Adding Support for Emscripten
Adding a 3d perspective, mallets, and a puck
Adding touch events and basic collision detection
The code is available on Github, with each section organized by tags.