Creates an ellipse at the mouses location

Assignment Help Programming Languages
Reference no: EM131477247

Assignment

When you complete a task, show it to me, and I will record that you got points for that task.

The listed due date is the last day we will have to work on these problems in-class. Any tasks you show me during class or e-mail to me by midnight that day will be worth full credit. (I will usually still ask to see e-mailed problems in class the next day.) After that day, tasks will earn you 20% fewer points per day. You can still get full credit on the assignment for 3 class days after the due date.

For all these problems you are required to use arrays and loops to avoid writing similar lines of code many times. Additionally, if only some elements of an array are relevant, you should make sure your code only uses those elements.

Tasks

1) Write a program that, every time you click the mouse, creates an ellipse at the mouse's location. The ellipse should then gradually move down at a constant rate. You don't need to worry about removing the ellipses from the array when they leave the screen, or making them stay on the screen.

2) Write a program that, whenever you press a letter key, displays that letter at the current location of the mouse (and keeps it there). This doesn't need to behave nicely if you press non-letter keys. (Hint: You will need to create a String array. In order to turn the key variable into a String, you can just add it to an empty string, like this: ""+key. There's no space in between those quotes.)

Tasks

1) Write a program that creates an ellipse every time you click the mouse, at the mouse's location. If you press 'a', then it should erase the earliest drawn ellipse that is still showing. If you press 'z' then it should erase the most recently drawn ellipse that is still showing.

2) Write a program that creates a rectangle every time you click, drag, and then release the mouse. One corner of the rectangle should be where you click the mouse, and the opposite corner should be where you release the mouse. The rectangle doesn't need to be shown while you are dragging the mouse, it can just show up when you release the mouse. (Hint: you will probably want to use the mousePressed() method to record where you click the mouse, and the mouseReleased() method to actually create the rectangle.)

Tasks

1) Write a program that allows you to "throw" ellipses on the screen. Whenever you click, drag, and release the mouse, it should create an ellipse where you release the mouse. The velocity of the ellipse should be proportional to how far you dragged the mouse...the further you dragged it, the faster it goes... and should be in the direction you dragged the mouse. (Hint: this means that the x-velocity should be proportional to x-distance you moved the mouse, and y-velocity is proportional to y-distance.) The ellipse should then bounce around the screen. Make it so that the ellipses move at a reasonable velocity for reasonable mouse movements, not super fast.
a. You can turn this into a 30 point task by having each ellipse bounce 3 times, and then disappear.

2) Write a program that creates ellipses at the bottom of the screen. They should always start out moving upwards, but they should have a random x velocity (that includes sometimes being to the right and sometimes being to the left). They should also all accelerate downwards (gradually changing y velocity). After they reach their peak and start falling back down, they should disappear when they are within 100 pixels of the bottom of the screen.

Tasks

1) Write a program that starts with several ellipses bouncing around the screen. Every time you click the mouse, it should create a black dot (a small ellipse) that moves straight upwards. If a dot hits one of the bouncing ellipses, both the dot and the big ellipse should disappear (and be removed from their respective arrays). If the dot gets to the top of the screen, it should disappear and be removed from its array.

Reference no: EM131477247

Questions Cloud

What will be the increase in xyz market value : XYZ Corp. is about to borrow $100,000. The terms of the loan specify an annual equal repayment of principal in each of the next 8 years.
Historical significance of the hebrew bible : What do you believe is the historical significance of the Hebrew Bible for Western Civilization? How has it influenced our civilization?
Explanation of the main purpose and scope of the cited work : Value and significance of the work (e.g., study's findings, scope of the research project) as a contribution to the subject under consideration.
Commentary for vitruvian man : Write a two-page in-depth commentary for vitruvian man and, of course, include the image of that work.
Creates an ellipse at the mouses location : Write a program that, every time you click the mouse creates an ellipse at the mouse's location. The ellipse should then gradually move down at a constant rate.
Explain the legislative and executive branches : Explain the Legislative and Executive branches based on the movie & connect to American History (include examples from movie/scenes)
What lab value will best reflect renal function : A nurse is reviewing a client's list of medications and notices that he is taking two anticholinergics.
Divine right of kings and absolute monarchy : Think about the pros and cons of the divine right of kings and absolute monarchy. What was good about these concepts? What was bad?
Calculate the given statistics for the two shares : The table below presents the year-end prices for the shares of Ford and PPG from 1989 to 2001.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd