Presentation is loading. Please wait.

Presentation is loading. Please wait.

B. RAMAMURTHY Lab1 Discussion. General Instructions Attend the recitation (s), office hours (s) to get help Read the Lab description Understand what is.

Similar presentations


Presentation on theme: "B. RAMAMURTHY Lab1 Discussion. General Instructions Attend the recitation (s), office hours (s) to get help Read the Lab description Understand what is."— Presentation transcript:

1 B. RAMAMURTHY Lab1 Discussion

2 General Instructions Attend the recitation (s), office hours (s) to get help Read the Lab description Understand what is needed. Collect all the images you need before you start. Design/plan before you start programming Book tells you to write a pseudo code before program… pseudo code is the “plan”  Flowchart is another representation for the plan

3 Lets plan Decide the permanent features and write the setup function + test it Collect/draw/create the images of all the creatures you want on the African Savannah. Write the functions for drawing the creatures on the Savannah You need to place the creatures/animals  You need to how to generate and use random numbers  Use mouseX and mouseY and the functions appropriately You need to know “if..else” /selection statement

4 Random function “random” is a function in Processing that helps to get random numbers random(high) ; random(low, high); randomSeed(0); void draw() { int color = int(random(255)); stroke(r); line(i, 0, i, 100); }

5 Selection/choice.. If.else statement if (expression) { statements } else { statements } Example: if (i < 35) { line(30, i, 80, i); } else { line(20, i, 90, i); }

6 Lets try these out Lets try random command and if else selection statement


Download ppt "B. RAMAMURTHY Lab1 Discussion. General Instructions Attend the recitation (s), office hours (s) to get help Read the Lab description Understand what is."

Similar presentations


Ads by Google