archives

New book on functional programming and games

Full disclaimer: I am an author of the book in question!

I have just finished writing a book about learning to program in F# with game development. I have gathered half a decade of teaching and development experience with functional programming and games. The main subject of the book is the F# language and its various constructs, but every single chapter is centered around a game-related problem. Each one of the first 5 chapters describes a problem, shows and discusses its solution and then discusses in depth the F# constructs used. The book has a (relatively rare) "problem-solution" approach where everything is explained because of how well it works in solving the problem, and not just "because". The 5 problems we present are:
- a bouncing ball
- the Saturn V rocket
- an asteroid field
- a large asteroid field optimized with quad trees
- a police starship that must fight off a pirate ship attacking a
cargo freighter
In the last two chapters we use XNA to build a 2D and 3D renderer for two of the samples we have seen. We show the basics of the SpriteBatch class, the Model class, input management and audio with this powerful framework. Basically, we cover the most important aspects of XNA in a simple and succint way.

The samples are all stored at: http://fsharpgamedev.codeplex.com/

The book is relatively short and cheap, and can be found here http://www.amazon.com/Friendly-Fun-game-programming-ebook/dp/B005HHYIWC/ref=sr_1_12?s=digital-text&ie=UTF8&qid=1313593351&sr=1-12
or here http://www.smashwords.com/books/view/81765

I will use this book as my textbook for my next course in game development at Università degli Studi di Verona and for my next course in functional programming at Università Ca' Foscari di Venezia.

I hope the book can be of interest for some people here; furthermore, I am more than willing (send me an email at giuseppemag AT gmail DOT com) to send a free copy of the book to any instructors who are interested in using it in the classroom!