Bootcamp - Team TEAL - Day 10

788 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
788
On SlideShare
0
From Embeds
0
Number of Embeds
356
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Bootcamp - Team TEAL - Day 10

  1. 1. TEA M TEAL LIZ RUTLEDGEDAY 10 rutle173@newschool.eduAugust 12, 2011 esrutledge@gmail.com
  2. 2. agenda. Review: Learn: whatever you want. TIME!!! (double-woooooooot!) likely candidates: namely: custom functions time functions for loops millis() if statements using a timer function mouse/keyboard interaction boolean “switches” arraysDAY 10Tuesday, 12 Aug 2011 CODE bootcamp 2011
  3. 3. homework an array of bouncing objects! questions? mind-blowing discoveries? new-found life goals?DAY 10Tuesday, 12 Aug 2011 CODE bootcamp 2011
  4. 4. using time in Processing. the concept: creating time-based events and interactions in your sketches to allow for more more traditional animations and delayed effects the syntax: millis()— measures time elapsed since beginning of sketch year(), month(), day(), hour(), minute(), second()— communicates with your computer to find the date and time of your system clockDAY 10Tuesday, 12 Aug 2011 CODE bootcamp 2011
  5. 5. how timers work. a quick example. // set up a simple timer to draw an ellipse 1 second after user clicks // (note: millis in milliseconds, so 1 seconds = 1000 millis) float lastSavedTime; float timeDelay = 1000; boolean drawCircleTrue = false; float mouseXClicked; float mouseYClicked; void setup() { lastSavedTime = millis(); ellipseMode(CENTER); size(400,400); smooth(); fill(255,20, 100); } void draw() { if(millis() - lastSavedTime > timeDelay) { drawCircleTrue = true; } if(drawCircleTrue) { using a ellipse(mouseXClicked, mouseYClicked, 80, 80); drawCircleTrue = false; combination of booleans and } } void mouseReleased() { a timer you lastSavedTime = mouseXClicked = millis(); mouseX; can achieve } mouseYClicked = mouseY; delayed effects.DAY 10Tuesday, 12 Aug 2011 CODE bootcamp 2011
  6. 6. using a counter. keeping track of how many times something has happened. [live example using previous code]DAY 10Tuesday, 12 Aug 2011 CODE bootcamp 2011
  7. 7. homework. due Monday, August 15th. time-based madness! interactive colorful moving things that are time-based. yep, it’s that open-ended. also: come up with an idea/some ideas for your final project.DAY 10Tuesday, 12 Aug 2011 CODE bootcamp 2011

×