http://sleepeater.net/comp115assignment3HD/applet/
using: classes, methods and arrays.
Each ball has the following characteristics –
diameter (between 20 and 80 pixels)
color (random)
location (random, but such that the entire ball is within the window)
speed in x and y directions (each speed component is a random value
between 0.1 and 2.0)
additionally for fading, it has –
opacity and
speed of fading
The number of balls that are generated are between 5 and 20.
(16%) Using collideWith(Ball other) method to implement collision between Balls.
i know i can't really do this but i need urgent help guys, and i would honestly appreciate it because i dont want to fail this hard course, i need it to graduate, thankyou heaps.
several balls moving around the display window and rebounding off the edge. For higher grades, you are required to add the following functionalities –
Fading of the balls while moving
Ensure that, at the time of generation, none of the balls overlap
Utilize collideWith(Ball other) method provided to implement
collision of balls with each other.
Please note that although you CAN implement a solution without using Classes to obtain up to 84% marks, an implementation using Classes would be much simpler and logical.
Each ball has the following characteristics –
diameter (between 20 and 80 pixels)
color (random)
location (random, but such that the entire ball is within the window)
speed in x and y directions (each speed component is a random value
between 0.1 and 2.0)
additionally for fading, it has –
opacity and
speed of fading
The number of balls that are generated are between 5 and 20.
Demonstration of the working of the programs is available at –
http://sleepeater.net/comp115assignment3P/applet/ http://sleepeater.net/comp115assignment3Cr/applet/ http://sleepeater.net/comp115assignment3D/applet/ http://sleepeater.net/comp115assignment3HD/applet/
Problem solving
Control structures
Arrays
Classes and Objects
USING THIS CODE BELOW:
class Ball {