Hello, my name is Herman van der Meulen.
Started with no C and NDS knowledge a few weeks ago, I have now built a simple game!
I will try to write the events in this one post in chronological order:
Installing (on Mac OS X)
For C programming specific to the NDS, the workshops were pretty short but the given code examples were very useful.
Installing (on Mac OS X)
A huge pane! Covered on http://drunkencoders.com/nintendo-ds-getting-started/
I used the Eclipse IDE, which is ‘OK’ for NDS development. A lot of configuration is needed though.
I really wanted to experience programming for a touch input device. That’s why I designed a game that is almost 100% playable with the touch screen.
It’s as simple as this: Build a pipe from the tap (‘2’ in drawing) valve to a drain (‘3’ in drawing) covering all the available space, in one single build. If needed, you can place one ‘key rock’ on the field, to solve the puzzle.
Instead of the insisted ‘top-down’ approach, I started coding ‘bottom-up’. I started by designing and programming the drawLine() function successfully (twice!) before noticing that it cannot be done perfect on a digital screen! So I used the function of Contrechoc after that experience, which isn’t perfect either.
I then tried to draw a line on the screen with the touch screen and display on which ‘block’ the pen is at any time. This was version 1: download (source and binary, in zip file)
In the next version (2, not online), I remembered where the pen was before the current position, so a route could be drawn.
Version 3 already has the basic game functionality without the ‘key rock’ and only a single level, build mistakes (warnings) printed on the console (top screen): download (source and binary, in zip file)
Version 4 is version 3 but with bitmap images. A lot of work. I designed everything myself. Very pixel based bitmaps, 26×26 pixels. I really like the result, I’m not a designer… download (source and binary, in zip file)
Version 5 has added sound, some levels and displayed current level and warnings, in text built from one bitmap image (font image). There is still no ‘key rock’ functionality. download (source and binary, in zip file)
Version 6 is the current and ‘final’ version for my IEPRO course. Key rock functionality built in. This makes for more interesting levels. There is a tutorial-like first level and a total of 17 playable levels and a ‘You won!’ screen at the end: download final version(source and binary, in zip file)
First of all, (my experience with) pointers still ‘suck’ The most extremely weird problems, (almost) not traceable, are because of pointer errors. That’s why I barely use them. Only if really needed for NDS functionality.
I changed the makefile to a makefile from one of Contrechoc’s examples to get all the sound and images functionality.
Includes can be difficult to understand and get right. Take a good look at examples and you will find logic in it. I won’t go into this problem. If you understand it, it’s not that hard.
Custom fonts are difficult, but educational! You will need different self made bitmap functions to write a simple string of text on the screen. (all can be found in my draw.c )
Of course, I had a lot of tiny errors, bugs and mistakes. This is in part due to the very low level C language (compared to my experience with Java, PHP etc.) and the strange NDS dialect, options and configurations.
All in all, a very, VERY useful and educational experience! But if I ever want to program a game, I will not likely take C as the programming language. Still, it’s almost always needed for embedded devices. Maybe I’ll give C++ a try someday.
Good luck and have fun!
Herman van der Meulen