ABSTRACT

Chapter 3 of this sequential learning series presents readers with an introduction to custom variables for automated animations. In previous chapters, lessons and examples demonstrated basic shape animations driven by mouse input. In this chapter, readers learn to implement variables that hold numerical values which increase or decrease over time. These fluctuating numerical variables are then used for automated shape transformations including directional movement and scaling. The lessons then move onto techniques for constraining variables values, randomizing variable values, and automating shape rotations. This chapter also expands on Processing's “print line” command as an essential tool for debugging programs. The chapter lessons conclude with an overview of Processing's mouse pressed command. The end of the chapter project is a 2D shape based environment with automated animations triggered by custom variables. Several project examples are provided for download from the publisher's website.