CS1331 Homework 4 - Pokemon Battle

HW4 Files

Introduction

In this assignment, you will be using inheritance and polymorphism to depict Pokemon and their interactions.

Problem Description

You wanna be the very best (programmer), like no one ever was! To have great Object Oriented Design is your real test, to learn it is your cause!

Note: You don’t need any prior knowledge about Pokemon to succeed with this assignment. The instructions will provide all necessary information to help you understand what needs to be done.

You will be given a GUI that represents the Pokemon world, separated into territories that help or hinder certain types of Pokemon. Within this world you will build classes that represent 4 different species of Pokemon. You will then form logic to make Pokemon species (instances) of different types interact with others.

Solution Description

Three blank files have been provided for you with the correct names, you should write your code in these files.

PokeWorld

We are giving you a GUI that represents the Pokemon world. The three files that represent this are: PokeBattle.java, PokeWorld.java, and ControlPanel.java. Also, we have included Pokemon.java with one method filled out for you.

Because we are giving you a GUI structure to work with, we will require you to name some methods and classes in a specific way. If you see the name of a class or method that you need to write mentioned in this document, you should name it as such.

You will need to change ControlPanel.java (check the TODOs at lines 18 and 44) and PokeWorld.java (check the TODO at line 165) to accommodate your custom Pokemon.

Pokemon Hierarchy

The main purpose of this assignment is to implement the classification of Pokemon species within the Pokemon world. Remember, you will be making instances of these Pokemon that run around in your GUI and interact with other instances of other Pokemon. We will be giving you a little bit of guidance on specific methods to write, but a large part of this assignment will be you designing classes on your own!

Pokemon class

The top level of your hierarchy should be an abstract class called Pokemon. We have provided you with a stub for this class that includes the draw(Graphics g) method implemented. This class will have certain instance variables and methods that all Pokemon will have in common.

Remember what the purpose of an abstract method is and when to use them. We won’t tell you which of these methods should be abstract, but you should make good design decisions and figure it out on your own. Here are the methods that the GUI requires from Pokemon. You must implement these methods for the GUI to work. You may add more methods if you’d like, but always remember to use good OOP design.

The Pokemon world will be divided geometrically into four sections. The sections provide benefits to their corresponding types: the Fire section (orange), the Grass section (green), the Water section (blue), and one remaining section to be explained below (white).

Pokemon types

Some notes about all Pokemon Types:

FireType

When a FireType is in its orange quadrant (top-right), they move more quickly than they do in the other areas of the map (think about adding speed instance data?)

A FireType also has a greater chance of harming a GrassType and a lesser chance of harming a WaterType. The actual values that represent the probabilities are up to you!

WaterType

When a WaterType is in its blue quadrant (bottom-left), they level up more rapidly than they do in the other areas of the map

A WaterType also has a greater chance of harming a FireType and a lesser chance of harming a GrassType. The actual values that represent the probabilities are up to you!

GrassType

When a GrassType is in its green quadrant (top-left), they gain health rather than lose it.

A GrassType also has a greater chance of harming a WaterType and a lesser chance of harming a FireType. The actual values that represent the probabilities are up to you!

SpecialType

Note: You can call this class whatever you want (though coding convention highly suggests it be SomethingType for clarity).

The harming relationship between your special type and the other given types can be whatever you decide, but make sure to include it when you are writing the classes for the other types!

When a special type Pokemon is in its white quadrant (bottom-right), it gains any combination of the available abilities. Just ensure that it receives at least one ability.

Pokemon Species

Some notes about all Pokemon species:

Rapidash

Rapidash

The fire Pokemon Rapidash is a powerful Pokemon that can vanquish its enemies.

Poliwhirl

Poliwhirl

The water Pokemon Poliwhirl is titan of aquatic prowess.

Venusaur

Venusaur

The grass Pokemon Venusaur lets nothing get in its way, championing a flower on its back like a boss.

Special Species

This Pokemon must be of the special type you choose to create. You can give it any additional abilities and rules, as long as it doesn’t break any of the species rules provided.

If you are familiar with Pokemon, feel free to use a Pokemon you particularly like! If not, no worries; you can use one that we have provided for you or make up a Pokemon name you like and pick any old image.

For this assignment, you will also need to add an image for your special species. We have provided two additional images that you may use:

Pikachu and Flareon

If you want to use your own image put it in the src/main/resources folder with the other images we’ve provided. Just use http://image.online-convert.com/convert-to-png to convert it to png format, and specify an image size of 90 pixels x 90 pixels there as well!

General Tips

Here are some general tips for this assignment!

Javadocs

Checkstyle

You must run checkstyle on your submission. The checkstyle cap for this submission is 45 points. In future homeworks we will be increasing this cap, so get into the habit of fixing these style errors early!

A guide for setting up and running checkstyle can be found on this page on the course website. Make sure you click “Save” when downloading the jar file, and not “Run”. To run, copy the jar file into the registration folder. Run checkstyle for this assignment with java -jar checkstyle-6.2.2.jar -a *.java. This will check for both checkstyle errors and javadoc errors.

Collaboration with other students

When completing homeworks for CS1331 you may talk with other students about:

You may not discuss, show, or share by other means the specifics of your code, including screenshots, file sharing, or showing someone else the code on your computer, or use code shared by others.

Examples of approved/disapproved collaboration:

Collaborating with others in a way that violates the approved means is a Georgia Tech Honor Code violation, and you will also break your TAs hearts :broken_heart:

Turn-in Procedure

Export the hw4 folder and its contents to a .zip file and submit the .zip file on T-Square as an attachment. Make sure your zip includes all necessary files to run the program! When you’re ready, double-check that you have submitted and not just saved a draft.

Verify the Success of Your Submission to T-Square

Practice safe submission! Verify that your HW files were truly submitted correctly, the upload was successful, and that your program runs with no syntax or runtime errors. It is solely your responsibility to turn in your homework and practice this safe submission safeguard.