My first concept was based around the code i produced, which caused 3 balls to bounce around in the 500x500 space. I then proceeded code in sound, causing a *ding* to be made each time one of the balls hit the sides.
if x location equals 0 or 500, or y location equals 0 or 500 - play sound
I then made a larger ball that followed the mouse.
ellipse (mouseX,mouseY,100,100);
I then intended to code it so the small balls bounced off the larger ball and there for be controlled but then I came up with a more visually satisfying concept.
I replaced the previous Large ball with a line that connected 2 corners with the mouse. The balls we going to bounce off the line and thats how the balls were going to be interated with. 
I made the code but it did not work..
When the balls distance from the top corner plus the mouse added together was less than the distance between the mouse and the corner plus a little, it would bounce off.
if((dist between ball and mouse) + (dist between ball and mouse)) < (dist betwen mouse and corner + 50){
bounce off;
}
But is did not react in the way I wanted and so I altered my code. 
I decided to made the balls' movements alter the background. So every time the ball would hit a side, it would change the colour of 1 or more triangles in the background, as well as make a *ding* sound. The ball was interacted with my a rod that followed the mouse. The ball would bounce off the rod.
When ball hits side (change background and make sound)
When ball hits rod (bouce off)
My final concept is a continuation of the last where when the ball hits the side, the background colours change and a sound is made, But I changed the interation.
I created to areas, top and bottom. If the mouse is in the top area, the ball grows and visa versa. 
To stop the balls growing inusably big, or far to small: when it reaches a certain size it returns to a viable size.




0 comments
Post a Comment