Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Odds and Ends12/2/2009Opening Discussion●Do you have any questions about the quiz?Motivation●I got some suggestions, but none seemed exactly inspired, so I want to throw out a few things that you could use to make something more interesting.●I want us to make a simple keyboard controlled applet that can load in some things from file over the network.●Don't try to follow along this week. Stop me if you have questions.Jumping Physics●One idea I did get was for a game like Mario where a character jumps.●Let's make an actor we can move side to side with arrow keys and jump with the space bar.●Gravity is a constant acceleration so we want to keep position and velocity for the character. Apply a downward acceleration if the character isn't supported.Simple User Interactions●Our infinite notepad used keyboard input to get strings. This can be a pain.●What if we want to ask questions, give information, or present options to a user?●The javax.swing.JOptionPane class has a set of method that will bring up basic dialog boxes.●We could make it so one pops up under certain conditions.Reading Network Files●The day before Thanksgiving we added the ability to read image files.●What about other files? What about having files for a “map” in our little game?●Alternately, we could have an option to change the image of the player, or to set a background image.Maps●We have used Lists and arrays in Java. There is another data structure worth talking about just a bit called a map.●The List and the array let you store values and look them up by their indexes. The map lets you look up a value by any type of key.●An example is a phone book where you look up a phone number by a person's name.Minute Essay●What questions do you have about the topics for today?●Remember that the design for project #2 is due on
View Full Document