Based on years of programming psychological tasks myself as well as helping others do so, this book aims to provide the foundations of building experiments. The sequence of canonical examples introduce a wide variety of concepts and techniques, working up from very basic tasks with a lot of detailed explanation to more challenging work.
The book only covers programming in Neurobehavioral Systems' Presentation, but I hope the examples could also provide good exercises for getting to grips with other languages. The example tasks are an Emotional Stroop task, an Approach Avoidance task, a Conditioning task, and a Visual Working Memory task. The final programs are built up via the same process an experienced programmer might follow. The examples will illustrate the use of conditional statements, loops, response handling, using arrays to control randomization, flexible animation using textures and planes, titration of difficulty, and the use of trigonometry and line graphics to generate geometric stimuli.
A webpage for the book is available at http://www.tegladwin.com/books.php.