Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9More Interesting Applets11/23/2009Opening Discussion●Do you have any questions about the quiz?●Minute essay responses–Eclipse/applets – 11–Greenfoot – 4–VBScript – 1–Software industry – 1–Specific ideas●Networked notepad●Personal finance/investment software●Applet gamesMaking an Applet Game●We'll run with the idea of trying to make something game like in an applet.●To do this, I want us to write something that gives us functionality similar to Greenfoot?●Let's talk about this and think about what would have to go into something like this. What different elements do we need?Making Actors●Greenfoot really gave us two main elements we could work with: World and Actor.●Our applet will function as the World for now to keep things simple.●We need to create something that can function like the Actor type in Greenfoot.●What should go into this? We want to keep it simple so what are the pieces of information we really need to have?Images●We might want to have the ability to have images instead of just colored polygons.●For this we will use the java.awt.BufferedImage class. It is a subclass of java.awt.Image.●We can get the Graphics object of an image to draw things to them.Reading Images●The Applet class has a getImage method that we can use, but it has some complications.●The alternative is to use the javax.ImageIO class.●In both cases, if we are using an applet we specify the image we want to read with a URL.Making it Run●We can make our game run by putting in a timing and putting some logic into the actionPerformed method.●This is basically the same as what we did for animations only now we are telling some actors to act.Getting Input●We will get input the same way we did before with applets by making our class be a listener.●All of the input will come into the applet class. We have to decide if and how we want to get that information into any actors.Minute Essay●What questions do you have about what we did
View Full Document