import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
import javax.swing.Timer;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Random;
public class finalB extends JPanel
{
//integer variable setup
int x, y, x1, y1, i, del; // these are all defined as integers
// display library class-- load premade java component code
public void paintComponent( Graphics g )
{
super.paintComponent( g ); //call superclass' paint method from library
this.setBackground( Color.BLACK );
//draw walls
g.setColor( Color.BLUE );
g.fillRoundRect( 5, 5, 5, 400, 2, 2 ); //(x, y, w, l, curvature of rounds x2) LEFT WALL
g.fillRoundRect( 165, 5, 5, 400, 2, 2 ); // RIGHT WALL
g.fillRoundRect( 3, 552, 168, 5, 2, 2 ); // BOTTOM FLOOR
//draw ramps
g.setColor( Color.CYAN );
g.drawLine( 18, 40, 118, 55 ); //first 2 integers are 1st point, second 2 are 2nd point
g.drawLine( 60, 110, 157, 95 );
g.drawLine( 18, 155, 118, 175 );
g.drawLine( 60, 235, 157, 220 );
g.drawLine( 18, 285, 118, 300 );
g.drawLine( 60, 360, 157, 345 );
//start 1st white egg's for loop here - MOVES 1st ramp's eggs each iteration according to the math in the loop. giving it a less than 10 definition: means it will repeat until i has been made 9 times.
for ( i=0; i<10; i++ ){
g.setColor( Color.WHITE );
g.fillOval( 20 + i*10, 16, 18, 23 ); //x, y, w, h - FIRST egg position, this MAKES eggs (i*??)
//g.fillOval( 110, 33, 23, 18 ); // - TENTH egg's position; right now this line is not doing anything, it's just here to show about where the 1st egg should stop
//1st BLACK eggs - these hide the white ones to create the illusion of 1 egg moving
g.setColor( Color.BLACK );
g.fillOval( 23 + i*10, 16, 23, 18 );
//g.fillOval( 110, 33, 23, 18 ); // - final 1st egg's supposed position
} //end 1st ramp's eggs for loop
//2nd eggs' for loop here
for ( i=10; i>0; i-- ){
g.setColor( Color.WHITE );
g.fillOval( 59 + i*8, 76, 23, 18 );
//2nd BLACK eggs
g.setColor( Color.BLACK );
g.fillOval( 61 + i*4, 76, 18, 23 ); //NOTE: this egg isn't in the right spot, I will have to change it later to start at the right end of the ramp instead of the left.
} //end 2nd ramp's eggs' for loop
//3rd white egg's for loop here.
for ( i=0; i<10; i++ ){
g.setColor( Color.WHITE );
g.fillOval( 16 + i*10, 131, 18, 23 );
//3rd BLACK eggs
g.setColor( Color.BLACK );
g.fillOval( 19 + i*10, 131, 23, 18 );
} //end 3rd ramp's eggs' for loop
//4th eggs' for loop here
for ( i=10; i>0; i-- ){
g.setColor( Color.WHITE );
g.fillOval( 59 + i*8, 201, 23, 18 );
//4th BLACK eggs
g.setColor( Color.BLACK );
g.fillOval( 61 + i*4, 201, 18, 23 );
} //end 4th ramp's eggs' for loop
//5th white egg's for loop here.
for ( i=0; i<10; i++ ){
g.setColor( Color.WHITE );
g.fillOval( 16 + i*10, 262, 18, 23 );
//5th BLACK eggs
g.setColor( Color.BLACK );
g.fillOval( 19 + i*10, 262, 23, 18);
} //end 5th ramp's eggs' for loop
//6th eggs' for loop here
for ( i=10; i>0; i-- ){
g.setColor( Color.WHITE );
g.fillOval( 59 + i*8, 327, 23, 18 );
//6th BLACK eggs
g.setColor( Color.BLACK );
g.fillOval( 61 + i*4, 327, 18, 23 );
} //end 6th ramp's eggs' for loop
//"~~~" find a way to have all the 'busted egg' bits below not appear until the last "whole" black eggs are done moving down the final (5th) ramp
//busted egg
g.setColor( Color.WHITE );
g.fillOval( 59, 527, 18, 23 ); //main chunk
g.fillRect( 42, 478, 5, 3 ); //x, y, w, h - little bits start
g.fillRect( 80, 491, 3, 4 );
g.fillOval( 130, 500, 4, 3 );
g.fillOval( 140, 470, 3, 4 );
g.fillOval( 54, 482, 4, 4 );
//busted egg yolk
g.setColor( Color.YELLOW );
g.fillRoundRect( 20, 500, 3, 3, 1, 1 ); //(x, y, w, l, curvature of rounds x2)
g.fillRect( 50, 484, 3, 3 ); //x, y, w, h
g.fillRect( 85, 492, 3, 4 );
g.fillOval( 100, 505, 3, 3 );
g.fillOval( 130, 460, 3, 4 );
g.fillOval( 54, 472, 4, 4 );
//busted egg shaping (hiding bits of colored shapes previously made)
g.setColor( Color.BLACK );
g.fillRect( 62, 525, 13, 16 ); //x, y, w, l
g.fillRect( 60, 535, 3, 4 );
g.fillRect( 74, 535, 3, 4 );
g.fillRect( 57, 529, 23, 8 );
g.setColor( Color.YELLOW );
g.fillRoundRect( 63, 540, 10, 3, 1, 1 );
} // end method main
} // end class finalB