The white circle wiill be sized according to to the value placed in parantheses.Ħ Arguments Looking at the bouncing ball example, we could rewrtite the move() function to include an argument:ħ Arguments In order to move the ball twice as fast: Move(2) Ĩ Arguments We could also pass another variable or the result of a mathematical expression (such as mouseX divided by 10) in the function. This variable is a local variableto be used in that function (and only in that function). These are ellipse() function arguments and we encountered this in Chapter 1 when we learned to call functions for the first time.Ĥ Arguments Let’s write drawBlackCircle()to include an arguments:ĥ Arguments An argument is simply a variable declaration inside the parentheses in the function definition. We can’t just say draw an ellipse, we have to say draw an ellipse at this location and with this size. Instiead of merely saying “Move, “ a function might say “Move N number of steps”, where “N” argumentģ Arguments When we display an ellipse in Processing, we are required to specify details about that ellipse. You can think of them as conditions under which the function should operate. 2 Arguments Arguments are values that are “passed” into a function.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |