User Tools

Site Tools


processing_intro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
processing_intro [2015/07/06 22:57]
ffpaladin
processing_intro [2015/07/06 23:04]
ffpaladin
Line 93: Line 93:
 The code lines that start with // are comments. They do not change the functionality of a program, but are used to provider helpful hints to the programmer. Comments are an essential part of writing good code. Effective comments let you understand what a program does before running it. This is especially useful if you plan on sharing your codes with others. The code lines that start with // are comments. They do not change the functionality of a program, but are used to provider helpful hints to the programmer. Comments are an essential part of writing good code. Effective comments let you understand what a program does before running it. This is especially useful if you plan on sharing your codes with others.
  
 +<​code>​
 // this is a comment! tell me how your program works! // this is a comment! tell me how your program works!
 /*  This is a multi-lined comment. /*  This is a multi-lined comment.
Line 98: Line 99:
 Don’t forget to close me! Don’t forget to close me!
 */ */
 +</​code>​
    
-Let’s take a look at the green light ellipse ​code first.+Let’s take a make a green light ellipse first.
  
   ellipse (10, 20, 25, 25);   ellipse (10, 20, 25, 25);
Line 113: Line 115:
 Run your application to double check your work. That position looks about right! Run your application to double check your work. That position looks about right!
  
-Moving on to the yellow light. ​The horizontal positioning looks find but the yellow light is too far down our traffic light. +Now, create ​the yellow light. ​
- +
-To move the yellow light up, we need to decrease the y position value from its current value of 70. Let’s change it to 50: +
- +
-  ellipse(50, 50, 25, 25);+
    
-Much better! ​The red light is not positioned correctly at all, and is almost falling off of the screen. ​Can you guess what the correct x position is for the red light? By looking at our two previous ellipses, we can get the correct x position value of 50. When trying to adjust parts of your program, it is always useful to look back at the code you have already written, it usually contains hints about how to fix your current line of code!+Much better! Can you guess what the correct x position is for the red light? By looking at our two previous ellipses, we can get the correct x position value of 50. When trying to adjust parts of your program, it is always useful to look back at the code you have already written, it usually contains hints about how to fix your current line of code!
  
   ellipse(50, 100, 25, 25);   ellipse(50, 100, 25, 25);
Line 226: Line 224:
  
 http://​processing.org/​reference/​ http://​processing.org/​reference/​
- 
-Drawing app 
- 
-Bouncing ball 
- 
-Click bouncing ball 
/soe/sherol/.html/teaching/data/pages/processing_intro.txt · Last modified: 2015/07/06 23:04 by ffpaladin