Date: Mon, 07 Oct 2002 13:46:23 From: Mark Jacobson To: 810-061-01@uni.edu, 810-061-02@uni.edu Subject: Lab #5, Ball falls into Box... Here are two questions, and the answer to the 2nd question is definitely worth sharing with the entire Java class, both sections of 061. On Mon, 7 Oct 2002, Cinderella wrote: > I have a simple question, I was curious as to when our Test for Java will > be. Thanks, hopefully you get back to me today. Is it going to be > next week Monday? Also I have a simple question about the lab5. It seems > that when the ball falls into the box it doesn't really do anything. It > kind of looks like the ball is just floating right past the box. Do you > have any suggestions? See you Wednesday. Hi Cinderella, The test will be either on Monday or Wednesday. I will let you know which day as soon as that is decided. All that happens when the Ball falls past the bottom of the game frame is the first two things, and sometimes a third change will be noticed too: --- ----- 1. A message gets displayed as to whether it was a MADE or a MISSED SHOT. If the ball is a HIT and the previous one was a HIT, I guess you would not notice anything. The message is the same as before! 2. The ball disappears, due to the hide() method. 3. If the shot was a MADE SHOT, then the BOX object should jump to some new randomly chosen location, as the BOX object's moveBox() method is invoked whenever a Ball object --------- had its getLeft() value be greater than the Box's getLeft(), AND had its getRight() be less than the Box's getRight() value. The above description of the MADE SHOT should prove very helpful in helping you in the design of your Box and your Ball classes, and in writing your onBallHittingBottom() method of the Boxball class (Boxball class is the game itself). If you want to add a feature to show the MADE SHOTS total and the MISSED SHOTS total, then you would obviously be able to see some result for every shot, including two misses or two hits in a row. That is not required, but feel free to add it if you wish. It would be good extra practice of your Java and algorithms for counting. Mark