SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
TEA M TEAL



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

       Review:                                   Learn:
       ALL THE THINGS!                           displaying an image file:
                                                    PImage
       variables                                    createImage()
             how to declare them, when to           loadImage()
             use them                               image()

       conditionals
                                                 making things move:
             operators — &&, ||, !=, ==, >, <
                                                    background + draw() as animation tool
             if-statements — if, else if, else
                                                    incrementing variables in the draw() loop




DAY 5
Tuesday, 5 Aug 2011
                                                                                        CODE
                                                                                        bootcamp 2011
homework part 1.
                                          now wasn’t that fun?




        displaying text homework:
        questions?
        let’s put that bad boy together


        review:
        PFont
        loadFont()
        createFont()
        textFont()
        text()




DAY 5
Tuesday, 5 Aug 2011
                                                      CODE
                                                      bootcamp 2011
images.
                                               exactly the same as fonts. (because fonts
                                                         are just a collection of images.)




       displaying an image file:
       PImage
       createImage()
       loadImage()
       image()


       example:
       PImage sweetPhoto; // declare the variable
       sweetPhoto = loadImage(“sweet-photo.jpg”); // load the image into the variable
       image(sweetPhoto, 0, 0); // place the image at point (0, 0) (top left)



DAY 5
Tuesday, 5 Aug 2011
                                                                                 CODE
                                                                                  bootcamp 2011
bouncing ball homework.

         questions?
         go over logic of a bouncing ball as a class.




DAY 5
Tuesday, 5 Aug 2011
                                                        CODE
                                                        bootcamp 2011
making things move.

           the concepts.
           using background() and the loop to simulate movement


           the techniques.
           incrementing with each loop
           using conditional statements to change movement based on
           certain criteria.


           the syntax.
           incrementing variables (++, - -, +=, -=):
           ex:    x = x+1 is equivalent to x += 1


DAY 5
Tuesday, 5 Aug 2011
                                                                      CODE
                                                                      bootcamp 2011
conditionals!
                                                 the tool that allows you to do anything of
                                                                      any actual interest...




          the operators:                           examples:
          > greater than
                                                   println(3 > 5); // Prints what?
          >= greater than or equal to
          < less than                              println(5 >= 3); // Prints what?
          <= less than or equal to                 println(5 == 5); // Prints what?
          == equals
                                                   println(5 != 5); // Prints what?
          != does NOT equal
                                                   (hint: it’s either true or false!)

          what do they do?
          return a boolean value of whether or
          not the expression is in fact true




DAY 5
Tuesday, 5 Aug 2011
                                                                                        CODE
                                                                                        bootcamp 2011
if statements.

                                                        1. The test must be an expression that resolves to true or false.
       sample code:                                     2. When the test expression evaluates to true, the code inside the
       if (test) {                                      brackets is run. If the expression is false, the code is ignored.
              statements                                3. Code inside a set of braces is called a block.
       }


       examples:
       int x = 150;
       if (x > 100) { // If x is greater than 100,
              ellipse(50, 50, 36, 36); // draw this ellipse
       }
       if (x < 100) { // If x is less than 100
              rect(35, 35, 30, 30); // draw this rectangle
       }
       line(20, 20, 80, 80);




DAY 5
Tuesday, 5 Aug 2011
                                                                                                                  CODE
                                                                                                                  bootcamp 2011
if-else statements.
                                                           adding complexity.




        = a tree diagram made of code.

        if (test) {
              statements;
        }
        else {                else = execute only if first test
              statements 2;   is not met
        }


        if (test) {
              statements;
        }
        else if (test2) {     else if = execute only if first test is
              statements 2;   not met AND second test IS met
        }



DAY 5
Tuesday, 5 Aug 2011
                                                                        CODE
                                                                        bootcamp 2011
logical operators.
                                            sometimes one condition just
                                                           isn’t enough.




                                 examples:
                                 int a = 10;
                                 int b = 20;

                      && = AND   if ((a > 5) || (b < 30)) {
                                       line(20, 50, 80, 50);
                      || = OR    }
                                 // Will the code in the block run?

                      ! = NOT    if ((a > 15) || (b < 30)) {
                                       ellipse(50, 50, 36, 36);
                                 }
                                 // Will the code in the block run?




DAY 5
Tuesday, 5 Aug 2011
                                                                      CODE
                                                                      bootcamp 2011
the “NOT” operator.

            The logical NOT operator is an exclamation mark. It inverts the
            logical value of the associated boolean variables. It changes true
            to false, and false to true. The logical NOT operator can be applied
            only to boolean variables.


            examples:
            boolean b = true; // Assign true to b
            println(b); // Prints “true”
            println(!b); // Prints “false”
            println(!x); // ERROR! It’s only possible to ! a boolean variable




DAY 5
Tuesday, 5 Aug 2011
                                                                                   CODE
                                                                                   bootcamp 2011
homework.

       do:
       create a sketch with at least one bouncing ball using the logic and functions that
       we’ve learned this week. include an image file and/or text in your sketch.


       extra credit options:
       use an image instead of a simple shape for the bouncing ball
       include more than one ball in your sketch


       extra extra credit options:
       include rotation in your ball behavior
       include realistic bouncing behavior (whether just collision behavior or gravity/
       friction)



DAY 5
Tuesday, 5 Aug 2011
                                                                                          CODE
                                                                                          bootcamp 2011
final project.

       final project:
       create some kind of drawing tool, the less conventional the better


       this weekend:
       think about some ideas for your project—blue sky/crazy ideas are fine,
       i can help you scale it down next week. it’s better to dream big and
       translate great ideas into doable projects than to limit yourself from the
       start.




DAY 5
Tuesday, 5 Aug 2011
                                                                               CODE
                                                                                bootcamp 2011

Mais conteúdo relacionado

Destaque

3b international workshop e-Skills and IT Professionalism - chuck walrad
3b   international workshop e-Skills and IT Professionalism - chuck walrad3b   international workshop e-Skills and IT Professionalism - chuck walrad
3b international workshop e-Skills and IT Professionalism - chuck walrad"Chuck" (Charlene) Walrad
 
Bootcamp - Team TEAL - Day 9
Bootcamp - Team TEAL - Day 9Bootcamp - Team TEAL - Day 9
Bootcamp - Team TEAL - Day 9Liz 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
 
Analisis matematico lasalle hesser
Analisis matematico lasalle hesser Analisis matematico lasalle hesser
Analisis matematico lasalle hesser Alejandro Sandoval
 
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
 
[THESIS] Midterm Presentation
[THESIS] Midterm Presentation[THESIS] Midterm Presentation
[THESIS] Midterm PresentationLiz 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
 
Iris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory AccessoriesIris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory AccessoriesLiz Rutledge
 
[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUSLiz 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
 

Destaque (11)

3b international workshop e-Skills and IT Professionalism - chuck walrad
3b   international workshop e-Skills and IT Professionalism - chuck walrad3b   international workshop e-Skills and IT Professionalism - chuck walrad
3b international workshop e-Skills and IT Professionalism - chuck walrad
 
Bootcamp - Team TEAL - Day 9
Bootcamp - Team TEAL - Day 9Bootcamp - Team TEAL - Day 9
Bootcamp - Team TEAL - Day 9
 
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...
 
Analisis matematico lasalle hesser
Analisis matematico lasalle hesser Analisis matematico lasalle hesser
Analisis matematico lasalle hesser
 
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
 
[THESIS] Midterm Presentation
[THESIS] Midterm Presentation[THESIS] Midterm Presentation
[THESIS] Midterm Presentation
 
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
 
Iris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory AccessoriesIris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory Accessories
 
[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS
 
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
 

Semelhante a Bootcamp - Team TEAL - Day 5

Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Liz Rutledge
 
Mastering python lesson2
Mastering python lesson2Mastering python lesson2
Mastering python lesson2Ruth Marvin
 
Enrich Your Models With OCL
Enrich Your Models With OCLEnrich Your Models With OCL
Enrich Your Models With OCLEdward Willink
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Courseparveen837153
 
Bootcamp - Team TEAL - Day 8
Bootcamp - Team TEAL - Day 8Bootcamp - Team TEAL - Day 8
Bootcamp - Team TEAL - Day 8Liz Rutledge
 
Le Wagon Australia Workshop
Le Wagon Australia WorkshopLe Wagon Australia Workshop
Le Wagon Australia WorkshopPaal Ringstad
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfSathwika7
 
Testing in Python: doctest and unittest
Testing in Python: doctest and unittestTesting in Python: doctest and unittest
Testing in Python: doctest and unittestFariz Darari
 
ICDL Advanced Excel 2010 - Tutorial
ICDL Advanced Excel 2010 - TutorialICDL Advanced Excel 2010 - Tutorial
ICDL Advanced Excel 2010 - TutorialMichael Lew
 
Testing in Python: doctest and unittest (Updated)
Testing in Python: doctest and unittest (Updated)Testing in Python: doctest and unittest (Updated)
Testing in Python: doctest and unittest (Updated)Fariz Darari
 
Whitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsWhitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsYura Nosenko
 
unittest in 5 minutes
unittest in 5 minutesunittest in 5 minutes
unittest in 5 minutesRay Toal
 

Semelhante a Bootcamp - Team TEAL - Day 5 (20)

Writing tests
Writing testsWriting tests
Writing tests
 
Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3
 
Unit testing-patterns
Unit testing-patternsUnit testing-patterns
Unit testing-patterns
 
Mastering python lesson2
Mastering python lesson2Mastering python lesson2
Mastering python lesson2
 
Enrich Your Models With OCL
Enrich Your Models With OCLEnrich Your Models With OCL
Enrich Your Models With OCL
 
Testing in Django
Testing in DjangoTesting in Django
Testing in Django
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Course
 
Bootcamp - Team TEAL - Day 8
Bootcamp - Team TEAL - Day 8Bootcamp - Team TEAL - Day 8
Bootcamp - Team TEAL - Day 8
 
Le Wagon Australia Workshop
Le Wagon Australia WorkshopLe Wagon Australia Workshop
Le Wagon Australia Workshop
 
Python for Beginners(v2)
Python for Beginners(v2)Python for Beginners(v2)
Python for Beginners(v2)
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdf
 
Testing in Python: doctest and unittest
Testing in Python: doctest and unittestTesting in Python: doctest and unittest
Testing in Python: doctest and unittest
 
Chapter3
Chapter3Chapter3
Chapter3
 
ICDL Advanced Excel 2010 - Tutorial
ICDL Advanced Excel 2010 - TutorialICDL Advanced Excel 2010 - Tutorial
ICDL Advanced Excel 2010 - Tutorial
 
Microsoft excel 2010 useful formula & functions
Microsoft excel 2010   useful formula & functionsMicrosoft excel 2010   useful formula & functions
Microsoft excel 2010 useful formula & functions
 
Testing in Python: doctest and unittest (Updated)
Testing in Python: doctest and unittest (Updated)Testing in Python: doctest and unittest (Updated)
Testing in Python: doctest and unittest (Updated)
 
Python 101 1
Python 101   1Python 101   1
Python 101 1
 
Whitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsWhitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applications
 
unittest in 5 minutes
unittest in 5 minutesunittest in 5 minutes
unittest in 5 minutes
 
Unit Testing in iOS
Unit Testing in iOSUnit Testing in iOS
Unit Testing in iOS
 

Último

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Último (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Bootcamp - Team TEAL - Day 5

  • 1. TEA M TEAL LIZ RUTLEDGE DAY 5 rutle173@newschool.edu August 5, 2011 esrutledge@gmail.com
  • 2. agenda. Review: Learn: ALL THE THINGS! displaying an image file: PImage variables createImage() how to declare them, when to loadImage() use them image() conditionals making things move: operators — &&, ||, !=, ==, >, < background + draw() as animation tool if-statements — if, else if, else incrementing variables in the draw() loop DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 3. homework part 1. now wasn’t that fun? displaying text homework: questions? let’s put that bad boy together review: PFont loadFont() createFont() textFont() text() DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 4. images. exactly the same as fonts. (because fonts are just a collection of images.) displaying an image file: PImage createImage() loadImage() image() example: PImage sweetPhoto; // declare the variable sweetPhoto = loadImage(“sweet-photo.jpg”); // load the image into the variable image(sweetPhoto, 0, 0); // place the image at point (0, 0) (top left) DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 5. bouncing ball homework. questions? go over logic of a bouncing ball as a class. DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 6. making things move. the concepts. using background() and the loop to simulate movement the techniques. incrementing with each loop using conditional statements to change movement based on certain criteria. the syntax. incrementing variables (++, - -, +=, -=): ex: x = x+1 is equivalent to x += 1 DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 7. conditionals! the tool that allows you to do anything of any actual interest... the operators: examples: > greater than println(3 > 5); // Prints what? >= greater than or equal to < less than println(5 >= 3); // Prints what? <= less than or equal to println(5 == 5); // Prints what? == equals println(5 != 5); // Prints what? != does NOT equal (hint: it’s either true or false!) what do they do? return a boolean value of whether or not the expression is in fact true DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 8. if statements. 1. The test must be an expression that resolves to true or false. sample code: 2. When the test expression evaluates to true, the code inside the if (test) { brackets is run. If the expression is false, the code is ignored. statements 3. Code inside a set of braces is called a block. } examples: int x = 150; if (x > 100) { // If x is greater than 100, ellipse(50, 50, 36, 36); // draw this ellipse } if (x < 100) { // If x is less than 100 rect(35, 35, 30, 30); // draw this rectangle } line(20, 20, 80, 80); DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 9. if-else statements. adding complexity. = a tree diagram made of code. if (test) { statements; } else { else = execute only if first test statements 2; is not met } if (test) { statements; } else if (test2) { else if = execute only if first test is statements 2; not met AND second test IS met } DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 10. logical operators. sometimes one condition just isn’t enough. examples: int a = 10; int b = 20; && = AND if ((a > 5) || (b < 30)) { line(20, 50, 80, 50); || = OR } // Will the code in the block run? ! = NOT if ((a > 15) || (b < 30)) { ellipse(50, 50, 36, 36); } // Will the code in the block run? DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 11. the “NOT” operator. The logical NOT operator is an exclamation mark. It inverts the logical value of the associated boolean variables. It changes true to false, and false to true. The logical NOT operator can be applied only to boolean variables. examples: boolean b = true; // Assign true to b println(b); // Prints “true” println(!b); // Prints “false” println(!x); // ERROR! It’s only possible to ! a boolean variable DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 12. homework. do: create a sketch with at least one bouncing ball using the logic and functions that we’ve learned this week. include an image file and/or text in your sketch. extra credit options: use an image instead of a simple shape for the bouncing ball include more than one ball in your sketch extra extra credit options: include rotation in your ball behavior include realistic bouncing behavior (whether just collision behavior or gravity/ friction) DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011
  • 13. final project. final project: create some kind of drawing tool, the less conventional the better this weekend: think about some ideas for your project—blue sky/crazy ideas are fine, i can help you scale it down next week. it’s better to dream big and translate great ideas into doable projects than to limit yourself from the start. DAY 5 Tuesday, 5 Aug 2011 CODE bootcamp 2011