Computer Science & Software Engineering |
CSCI 136 |
You will be creating a Java GUI game in which you guide a stick man around. You will gain additional experience buildings Java GUIs and also with object inheritance. You will also be extending the game to add your own special game features. Exactly what features you add and how you do it is up to you! |
The first line specifies that the playing area of the game window will be 600 pixels by 400 pixels. The second line says the stick man should start at (140, 5) and should use the image file stick20.png. The third line says that there is a 10 millisecond delay between each update of the game. The fourth line says that the stick man moves 1 pixel at a time horizontally and 2 pixels at a time vertically (i.e. when falling). Following this are 0 or more lines containing the location, size and color of the level's platforms. In this case, there is one at (0, 370) that is 400 pixels wide and 10 pixels high. The platform is black since the RGB triple is 0, 0, 0.600 400 140 5 stick20.png 10 1 2 0 370 400 10 0 0 0 ...
stick0.txt | stick0.txt | stick1.txt | stick2.txt |
You should disable resizing of your JFrame by using the setResizable method. The size of your window should depend on the size of the game panel specified in the control file. To do this, you will need to call setPreferredSize on your custom JPanel that draws the game. After adding all the GUI widgets to the JFrame, you can make it size itself appropriately by calling the pack method. Make sure hitting the close box of your game window make the application terminate.BufferedImage offscreen = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Extra credit.
Add features that go above and beyond the call of duty.
Submission. Submit all your source programs including at least StickMan.java, Platform.java and Man.java to Moodle. Be sure each submitted source file has the required header with your name, username, and a description of the program. If your game involves lots of files/graphics/sounds, submit it as a single zip file. Page last updated: August 16, 2012 |