SlideShare a Scribd company logo
TEA M TEAL



                    LIZ RUTLEDGE
DAY 7               rutle173@newschool.edu
August 9, 2011      esrutledge@gmail.com
agenda.

         Review:                         Learn:
         All that hard stuff that just   MOUSE INTERACTION!
         keeps ACCUMULATING!             (yayyyyyyyyy)



         namely:                         namely:
             if-statements                 mouseX, mouseY
             conditional operators         pmouseX, pmouseY
             nested if-statements          mousePressed
             the dreaded for loop          mouseReleased



DAY 7
Tuesday, 9 Aug 2011
                                                              CODE
                                                              bootcamp 2011
homework
                                      now wasn’t that fun?




        the for-loop parade:
        questions?
        let’s look at a few!


        review:
        the structure of a for loop
        why we use for loops
        anything else?




DAY 7
Tuesday, 9 Aug 2011
                                                  CODE
                                                  bootcamp 2011
mouse interaction!
                                                                        finally the good stuff!




        the concept:
        actually being able to include user input in your sketch through the position
        and activity of their mouse and keyboard




DAY 7
Tuesday, 9 Aug 2011
                                                                                        CODE
                                                                                        bootcamp 2011
mouse position.
                                                                 home is where their mouse is.




            the syntax:

            mouseX, mouseY
              the location of the user’s mouse

            pmouseX, pmouseY
              the location of the user’s mouse exactly one loop ago
                 note: this allows you to very easily get the CHANGE in mouse
                 position (i.e. which direction the user is moving his/her pointer)




DAY 7
Tuesday, 9 Aug 2011
                                                                                      CODE
                                                                                      bootcamp 2011
mouse inputs.
                                                                                 clicks, drags, movements, etc.




        variables.
        mousePressed (boolean) tells you if the mouse button is pressed
        mouseButton variable that tells you which button was clicked (LEFT or RIGHT)


        functions.
        these allow you to create entire series of events every time corresponding condition has occurred

        mousePressed()
        mouseReleased()
        mouseDragged()
        mouseMoved()
        mouseClicked()




DAY 7
Tuesday, 9 Aug 2011
                                                                                                            CODE
                                                                                                            bootcamp 2011
keyboard inputs.

       variables.
       keyPressed (boolean) whether or not a key (any key) is pressed



                         }
       only useful inside    key which key is being pressed (ex: ‘a’, ‘b’, ‘B’, ‘x’, ‘ ‘ ) as string
        one of the below
       functions or an if-   keyCode which key is being pressed if a non-ASCII key as a CODE
       statement testing
         for keyPressed      (ex: BACKSPACE, TAB, ENTER, RETURN, ESC, and DELETE)



       functions.
       these allow you to create entire series of events every time corresponding condition has occurred
       keyPressed()
       keyReleased()
       keyTyped()




DAY 7
Tuesday, 9 Aug 2011
                                                                                                       CODE
                                                                                                       bootcamp 2011
homework.
                                                                                due Wednesday, August 10pth.




    do:
    Keyboard and Mouse Interaction: Googly Eyes!
    Create a pair of eyes that react to mouse/key input. (ex: Eyes follow your mouse wherever it goes, the eyes
    blink when you click, and anything else you can think of.)
    There are two possible versions you can do of this project depending on your comfort level with trigonometry:
          1. The “Boooo Trig” Version: Make the eyes rectangles or square and use the constrain() function to
          limit the pupil position
          2. The “Yay Trig!” Version: Make the eyes circular and calculate
          the positions of the eyes using dist(), sin(), cos(), and acos() or asin().
          You might also be able to use the constrain() function based on your
          approach.



    extra credit:
    Square Painter!
    Create three distinct types of squares to draw (differing in size, fill color, etc) and link each one to a keyboard
    command (a key or keyCode). The user should be able to press a key to “load their paintbrush” with each one
    of the square styles and draw them wherever they click like a stamp.



DAY 7
Tuesday, 9 Aug 2011
                                                                                                              CODE
                                                                                                               bootcamp 2011

More Related Content

Viewers also liked

Bootcamp - TEAM TEAL - Day 2
Bootcamp - TEAM TEAL - Day 2Bootcamp - TEAM TEAL - Day 2
Bootcamp - TEAM TEAL - Day 2
Liz Rutledge
 
LDM Global Corporate Overview
LDM Global Corporate OverviewLDM Global Corporate Overview
LDM Global Corporate OverviewLDM_gcampbell
 
Evaluation powerpoint question 4
Evaluation powerpoint question 4Evaluation powerpoint question 4
Evaluation powerpoint question 4niamhdilworth2000
 
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...Liz Rutledge
 
Evaluation powerpoint2
Evaluation powerpoint2Evaluation powerpoint2
Evaluation powerpoint2niamhdilworth2000
 
Dangkao History
Dangkao HistoryDangkao History
Dangkao Historylbbcpress
 
Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Liz Rutledge
 
Thvln 50 cau hoi tn
Thvln 50 cau hoi tnThvln 50 cau hoi tn
Thvln 50 cau hoi tnHa Luong
 
dataPlay: Sports Game Data Collection and Visualization [Information Design A...
dataPlay: Sports Game Data Collection and Visualization [Information Design A...dataPlay: Sports Game Data Collection and Visualization [Information Design A...
dataPlay: Sports Game Data Collection and Visualization [Information Design A...
Liz Rutledge
 
SolarCity - The Hot shit!
SolarCity - The Hot shit!SolarCity - The Hot shit!
SolarCity - The Hot shit!
Fridge Organic
 
Carlos blanco resumen mm android controles 10pag v5
Carlos blanco resumen mm android controles 10pag v5Carlos blanco resumen mm android controles 10pag v5
Carlos blanco resumen mm android controles 10pag v5
Carlos Blanco
 

Viewers also liked (11)

Bootcamp - TEAM TEAL - Day 2
Bootcamp - TEAM TEAL - Day 2Bootcamp - TEAM TEAL - Day 2
Bootcamp - TEAM TEAL - Day 2
 
LDM Global Corporate Overview
LDM Global Corporate OverviewLDM Global Corporate Overview
LDM Global Corporate Overview
 
Evaluation powerpoint question 4
Evaluation powerpoint question 4Evaluation powerpoint question 4
Evaluation powerpoint question 4
 
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
 
Evaluation powerpoint2
Evaluation powerpoint2Evaluation powerpoint2
Evaluation powerpoint2
 
Dangkao History
Dangkao HistoryDangkao History
Dangkao History
 
Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3
 
Thvln 50 cau hoi tn
Thvln 50 cau hoi tnThvln 50 cau hoi tn
Thvln 50 cau hoi tn
 
dataPlay: Sports Game Data Collection and Visualization [Information Design A...
dataPlay: Sports Game Data Collection and Visualization [Information Design A...dataPlay: Sports Game Data Collection and Visualization [Information Design A...
dataPlay: Sports Game Data Collection and Visualization [Information Design A...
 
SolarCity - The Hot shit!
SolarCity - The Hot shit!SolarCity - The Hot shit!
SolarCity - The Hot shit!
 
Carlos blanco resumen mm android controles 10pag v5
Carlos blanco resumen mm android controles 10pag v5Carlos blanco resumen mm android controles 10pag v5
Carlos blanco resumen mm android controles 10pag v5
 

More from Liz Rutledge

dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
Liz Rutledge
 
data_coach: midterm review + user testing plans
data_coach: midterm review + user testing plansdata_coach: midterm review + user testing plans
data_coach: midterm review + user testing plansLiz Rutledge
 
Information Design in the Urban Environment: Personal Observations
Information Design in the Urban Environment: Personal ObservationsInformation Design in the Urban Environment: Personal Observations
Information Design in the Urban Environment: Personal ObservationsLiz Rutledge
 
[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUSLiz Rutledge
 
[THESIS] Midterm Presentation
[THESIS] Midterm Presentation[THESIS] Midterm Presentation
[THESIS] Midterm PresentationLiz Rutledge
 
Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10Liz Rutledge
 
Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5Liz Rutledge
 
Iris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory AccessoriesIris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory Accessories
Liz Rutledge
 
DT Outfitters | Designed Object Presentation
DT Outfitters | Designed Object PresentationDT Outfitters | Designed Object Presentation
DT Outfitters | Designed Object PresentationLiz Rutledge
 
Follow the Mellow Brick Glow | An Augmented Space Project
Follow the Mellow Brick Glow | An Augmented Space ProjectFollow the Mellow Brick Glow | An Augmented Space Project
Follow the Mellow Brick Glow | An Augmented Space ProjectLiz Rutledge
 

More from Liz Rutledge (10)

dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
 
data_coach: midterm review + user testing plans
data_coach: midterm review + user testing plansdata_coach: midterm review + user testing plans
data_coach: midterm review + user testing plans
 
Information Design in the Urban Environment: Personal Observations
Information Design in the Urban Environment: Personal ObservationsInformation Design in the Urban Environment: Personal Observations
Information Design in the Urban Environment: Personal Observations
 
[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS
 
[THESIS] Midterm Presentation
[THESIS] Midterm Presentation[THESIS] Midterm Presentation
[THESIS] Midterm Presentation
 
Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10
 
Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5
 
Iris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory AccessoriesIris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory Accessories
 
DT Outfitters | Designed Object Presentation
DT Outfitters | Designed Object PresentationDT Outfitters | Designed Object Presentation
DT Outfitters | Designed Object Presentation
 
Follow the Mellow Brick Glow | An Augmented Space Project
Follow the Mellow Brick Glow | An Augmented Space ProjectFollow the Mellow Brick Glow | An Augmented Space Project
Follow the Mellow Brick Glow | An Augmented Space Project
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Bootcamp - Team TEAL - Day 7

  • 1. TEA M TEAL LIZ RUTLEDGE DAY 7 rutle173@newschool.edu August 9, 2011 esrutledge@gmail.com
  • 2. agenda. Review: Learn: All that hard stuff that just MOUSE INTERACTION! keeps ACCUMULATING! (yayyyyyyyyy) namely: namely: if-statements mouseX, mouseY conditional operators pmouseX, pmouseY nested if-statements mousePressed the dreaded for loop mouseReleased DAY 7 Tuesday, 9 Aug 2011 CODE bootcamp 2011
  • 3. homework now wasn’t that fun? the for-loop parade: questions? let’s look at a few! review: the structure of a for loop why we use for loops anything else? DAY 7 Tuesday, 9 Aug 2011 CODE bootcamp 2011
  • 4. mouse interaction! finally the good stuff! the concept: actually being able to include user input in your sketch through the position and activity of their mouse and keyboard DAY 7 Tuesday, 9 Aug 2011 CODE bootcamp 2011
  • 5. mouse position. home is where their mouse is. the syntax: mouseX, mouseY the location of the user’s mouse pmouseX, pmouseY the location of the user’s mouse exactly one loop ago note: this allows you to very easily get the CHANGE in mouse position (i.e. which direction the user is moving his/her pointer) DAY 7 Tuesday, 9 Aug 2011 CODE bootcamp 2011
  • 6. mouse inputs. clicks, drags, movements, etc. variables. mousePressed (boolean) tells you if the mouse button is pressed mouseButton variable that tells you which button was clicked (LEFT or RIGHT) functions. these allow you to create entire series of events every time corresponding condition has occurred mousePressed() mouseReleased() mouseDragged() mouseMoved() mouseClicked() DAY 7 Tuesday, 9 Aug 2011 CODE bootcamp 2011
  • 7. keyboard inputs. variables. keyPressed (boolean) whether or not a key (any key) is pressed } only useful inside key which key is being pressed (ex: ‘a’, ‘b’, ‘B’, ‘x’, ‘ ‘ ) as string one of the below functions or an if- keyCode which key is being pressed if a non-ASCII key as a CODE statement testing for keyPressed (ex: BACKSPACE, TAB, ENTER, RETURN, ESC, and DELETE) functions. these allow you to create entire series of events every time corresponding condition has occurred keyPressed() keyReleased() keyTyped() DAY 7 Tuesday, 9 Aug 2011 CODE bootcamp 2011
  • 8. homework. due Wednesday, August 10pth. do: Keyboard and Mouse Interaction: Googly Eyes! Create a pair of eyes that react to mouse/key input. (ex: Eyes follow your mouse wherever it goes, the eyes blink when you click, and anything else you can think of.) There are two possible versions you can do of this project depending on your comfort level with trigonometry: 1. The “Boooo Trig” Version: Make the eyes rectangles or square and use the constrain() function to limit the pupil position 2. The “Yay Trig!” Version: Make the eyes circular and calculate the positions of the eyes using dist(), sin(), cos(), and acos() or asin(). You might also be able to use the constrain() function based on your approach. extra credit: Square Painter! Create three distinct types of squares to draw (differing in size, fill color, etc) and link each one to a keyboard command (a key or keyCode). The user should be able to press a key to “load their paintbrush” with each one of the square styles and draw them wherever they click like a stamp. DAY 7 Tuesday, 9 Aug 2011 CODE bootcamp 2011