Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Assignment 7

This assignment is worth half of a normal assignment since we have a short turnaround and hopefully there isn’t much for you to do. In this final assignment you will polish everything nicely, and package your project as a jar file for distribution to your friends and family.

Part 1: Polishing Everything Up

You should get your game ready for ‘prime-time.’ In other words, be sure the messages the user receives are understandable and look good. Be sure the help output is up to date and has enough detail for someone to play the game. Remove any debug output (like the contents of the XML file, or anything else like that you may have added that doesn’t have to do with the game). Be sure to test your game – play it for a bit and make sure you are happy enough with it that you wouldn’t mind putting it in front of some other people to play. Things will go most smoothly if you are sure your program asks for an xml file to load when it starts up, and read it from the provided file.

Part 2: Create a jar file

Create a jar file:

  • Add the following to your build.gradle.kts file:
    tasks.jar {
        manifest {
            attributes["Main-Class"] = "game.Main"
        }
    }

    Be sure to change “game.Main” to the package and class file that is the main class file for your project!
  • Open the gradle window on the right side of IntelliJ (the icon looks like a elephant)
  • Navigate to Tasks, build, and then double-click the jar option.
  • Your jar file should build, and you should be able to find it in the build/libs folder inside your project.

Once you have a jar file, right click on it in IntelliJ and select Run. Your game should run! To be extra sure things are OK, open a terminal, get to the right directory, and run: java -jar yourjarfile.jar (obviously changing the name as appropriate). Your game should run there too!

To submit, on Brightspace submit:

  • A zip file of your game folder, as usual
  • The jar file you created
  • Any special xml file that might be required to run your game.

On the last day of classes, we’ll have a chance to play each others games!

Final Notes

This assignment is due Thursday at 5PM so that I have time to prepare an environment for us all to play each other’s games on Friday. Friday night at midnight is the absolute last time to submit any work for CSC241, so make sure everything you have is in by then.