Tuesday, 27 September 2016

27.09.2016

27.9.16

Research and Development with Spencer Roberts.

Open Processing —> 
Line 1 ‘void setup ( )—> {‘line 4’
Line 6 ‘void draw ( ) —> {‘line 9’3’ // double lines means comment out 
Line 3 ‘Println (“hello”) —> //this makes a message appear at the bottom of the processing page.
Line 7 ‘println(“hello”) —> again
Create spaces to work/code 

New Line 3 ‘size (800,000)’; —> 
New Line 6 ‘background (178,198,232)’ —> //RGB
New Line 7 ‘stroke (0,0,0)’ —> //RGB
New Line 8 ‘fill (0,0,0)’ —> //RGB
New Line 10 ‘line (100, 100, 800, 600)’ —> // draws a line diagonal 
New Line 11 ‘line (0, 300, 800, 300)’ —> // draws a horizontal line 
New Line 12 ‘line (400, 0, 400, 600)’ —> //draws a vertical line 

//eventually at this point i got use to adding additional co-ordinates so started to play with drawing more and more lines on my screen. 

//now we need to move into the draw section, so at this point I want to add in ellipses to go with every line. 

Line 20 ‘ellipse (50, 100, 10, 10); —> // these numbers are co-ordinates of the points for the ellipse
Line 21 ‘ellipse (600, 100, 10, 10); —>
Line 22 ‘ellipse(470, 200, 10, 10); —> 

(400, 300, 50, 50) ;
(400, 300, 150, 150); 
(400, 300, 250, 250); // these co-ordinates don't work as it has the fill colour, not just an outline. 

New Line 1 ‘float xpos1;’ —> // computer wants to know what can go in.
New Line 2 ‘float ypos1;’ —> 
// Then go back under set up and link boxes to ellipses xpos1=50; ypos1 =100; 

//Then change 1st ellipse’s digits to (xpos1, ypos1, 10, 10); 

New Line 34 ‘xpos1=xpos1+1’;
New Line 35 ‘ypos1+ypos1+5’; // if you add a higher value like +5 the faster the element moves, if you minus it will go the opposite way. 

//We now need to get the ball to stop going off the page. 

Line 36 ‘if(ypos1>600){‘; —>
// Now add float xspeed1; floatyspeed1; 
//xspeed1=1 yspeed1=5
//xpos1=xpos1+xspeed1 
//ypos1+ypos+yspeed1 

Now it will bounce side to side


I will add some screen shots in from this class however I now feel that I couldn't do these codes for each class, as I feel like i’m falling behind. The homework for this week was to get all three points moving however by the end of the class I had in fact done this.

No comments:

Post a Comment