Giter Site home page Giter Site logo

week1.day1.clickboxes's Introduction

week1.day1.clickBoxes

Instructions

  1. Use command line to create a new project folder called clickBoxes
    • Navigate into the folder and create your required files (index.html, sketch.js)
    • Include a reference to p5.js in your index.html file
  2. In your sketch.js, setup your canvas (600x600)
    • Draw 2 squares, one taking up the entire left side of the canvas and the other taking up the right side.
    • Fill the squares with the color blue
  3. When the blox is clicked, have the color of the box being clicked change from blue to red (it should stay that way, until pressed again).
    • Hint: Consider using an array to keep track of multiple pieces of related information. You can then loop through the array.
  4. When the mouse is pressed again, the color should change back to red.

Extra Credit

  • Make your boxes smaller (100x100) - the space around both boxes should just be background
    • The color of each box should still only change when clicked by the mouse
    • Hint: think about what it means for the mouseX and mouseY to be within the area of the boxes
  • Have both boxes "bounce" around the screen (much like we did for the bouncing ball)
    • Clicking on the box while it moves should still properly change its color

Helpful Resources

week1.day1.clickboxes's People

Watchers

James Cloos avatar Victor(ious) Ramirez avatar  avatar Mahdi Shadkam-Farrokhi avatar  avatar  avatar

Forkers

justinasc5mlb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.