Maelstrom for Nintendo DS - A game demo based on "Tempest"
by Dave Theurer
- Game ROM (Can be played on
real hardware. Tested with SuperCard MiniSD and M3 DS Simply)
- Game source (Requires DevkitPro to compile. The code was built using DevkitARM release 20 and libnds-2007-03-27. Linux users will find it useful to read the
DS development tutorial)
The view can now be moved by dragging the touch screen. When you do, you'll see that the outside of the tunnel becomes partially transparent to allow you to see all the action!
- D-pad to move around the tunnel and zoom in or out
- A or L to fire
- Touch screen to move view!
- X to switch between manual and automatic view (touching the screen switches to manual)
- Select toggles invincibility
Much of the code for MaelstromDS is the same as that in the original GBA version, the major change being that the DS has 3D hardware built in, and therefore there is no need for the code to transform the scene into 2D lines.
Additionally, the view can be moved by touching and dragging the screen. This is accomplished by capturing the initial touch position, and using this point as the "origin" from which translations are measured. The origin is subtracted from the current touch position, and this value used to determine the rotation (pitch and yaw) to apply to the scene. The value used is actually the average of the last two readings. This avoids shaking of the picture caused by slightly different values being read each frame, which occurs even when not dragging.
Finally, the transparency of the outside of the tunnel is achieved by drawing the tunnel twice. Once with the polygons set to solid and the front faces drawn, then with the polygons set to half transparent and the back faces drawn. This is necessary because the DS cannot correctly handle multiple transparent polygons drawn on top of each other.
Thanks must go to everyone who's contributed to DevKitPro and libnds, particularly the people who implemented the pseudo-OpenGL functions which made writing this demo so easy!
A particular thanks must go to Dovoto who converted the NeHe tutorial demos for use on the DS. Some of the initialisation and texture loading code was taken from these demos. Thanks!
About me, Philip Corner
I'm a programmer with ten-years' experience in C, C++ and other technologies. If you'd like a copy of my CV, please email me at: