Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

LoveJen Group Title

hey, I need help in computer processing. How do you get a shape to move according to the minute?

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. KonradZuse Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Explain?

    • 2 years ago
  2. LoveJen Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    In computer processing, I have to type a code that makes a certain shape (ex. ellipse) move after every minute. For example, the following code makes a circle move from left to right. My problem is that I need help typing a code that makes the ball move across the window according to the minute. float cx; float cy; final float DIAM = 20; float xSpeed = 1.0; void setup() { size(350, 250); smooth(); cx = DIAM / 2.0; cy = height / 2.0; } void draw() { background(255); fill(0, 128, 128); ellipse(cx, cy, DIAM, DIAM); cx = cx + xSpeed; if (cx > width - DIAM / 2.0) // about to go off sketch at the right { xSpeed = -xSpeed; } if (cx < DIAM / 2.0) // about to go off sketch at the left { xSpeed = -xSpeed; } }

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.