Another Gamy-game :)

Few month ago, I’ve discovered the marvelous world of MOOC and was looking for a fun course to take. Finally I found one on EdX: UT.6.01x Embedded Systems – Shape the World brought to us by the professor Jonathan Valvano and professor Ramesh Yerraballi.

Not that I really need to take such a course on embedded system as it is both my hobby and my job, but I always like to learn new things, and this could be fun. And it was 🙂

The course was well structured, in 15 lessons that goes from beginning with the C language to making a full fledge game 🙂 with inside learning thing like create a simple DAC with resistors, create and use Finite State Machine. All around a lab for each of those lesson with a final goal for each, the finite state machine lesson for exemple asked you to build a simpler, but quite realistic traffic light simulator, we even build a simple device for the DAC lesson to generate sound, yes Sound! You know the thing that I’ve always struggle to manage/generate in real time.. 🙂

They also make everyone work as close as possible to the hardware as they ask for people who want to pass labs to buy some stuffs, from a breadboard, some wires, resistors, switch, LED and a TI Tiva LaunchPad, all of these for less than 30€ (or ~$35-40) which is quite low as these uC board are pretty cheap and powerful. They asked us to use Keil in the “32K limited version” which was in fact more than enough for the project we had to make, and they also provide some plugin for Keil to add graphical view on some I/O parts of the Tiva/Stellaris chip, which was really great and proved to be useful.

It also allowed me to discover that Keil made a lots good changes and it is largely better than what it was at some times, expect for it’s price which is still too high.

Anyway, the last Lab of this course, which was optional because it didn’t give any point for grading, was to create a game, around the theme of Space Invaders using all the things that we learnt during the course. The only thing that was fixed by the professors was the connexion of the various input and output for the game. It was possible to use up to two LED, two button, one slider potentiometer, a 4bit DAC and a Nokia5110 screen, which is able to display 84×48 black and white pixels.

I accepted the challenge and in 2 or 3 day of work (by work I mean hobby work, not job work of course :)) I was finally able to propose something, not finished, but was working correctly and playable, i.e. the most important 🙂

Here is a video I made that show the current version of this game, that I called TInVAders, which is of course a contraction (and a pun) between the name of the µC used (Tiva) and the original name of this game: Space Invaders :

This game takes with the music and graphics around 10-15K of binary, but there is lots of place to gain as current bitmap storage is not really efficient (it is due to the fact that they provide the Nokia5110 driver and they asked us to only use their function, and there is a simple reason for this, they provide a version for the Keil simulator, and also a screen simulator for thoses who can’t buy a Nokia5110 screen and they can use their PC to have a display.

So they provide some graphic primitives that was made to be simple and easy to understand, and the way the graphics are stored are not really space efficient.

Anyway the current version of my game currently lack two things, LED animation and SFX. Both are due to lack of time, the first the engine is ready, but I didn’t had enought time to create nice looking LED animation to make the game better, and for the SFX, the sound engine is not completely ready to support it (some part are ready, like the switch between music and SFX) but I prefered to publish a game in time than not to.

Both will be added in a near future, I will clean the code and I think publish it on GitHub. The sound engin may also be changed to support multiple channel at the same time, including SFX so that the music won’t be override by the SFX, and maybe the music part will allow more play effect than just play/pause as it is currently 🙂

Anyway, I will keep you informed when the source become public 🙂

Nice watch!

Leave a Reply

Your email address will not be published. Required fields are marked *