logo

Programming Assignment #4.

2 Pages368 Words384 Views
   

Added on  2019-09-16

Programming Assignment #4.

   Added on 2019-09-16

ShareRelated Documents
Programming Assignment #4Role Playing GameYou are part of a team working on a new role playing game. Your part is to design and create the classes for the hierarchy of game objects (such as trees, walls, zombies, aliens, and good guys. You are to draw a complete class diagram that shows the entire hierarchy of your classes. For each class, come up with suitable methods based on the type of object. You also are to create aprogramcalledAssignment4 that tests the objects in a new role playing game. You are to designa class to represent each type of game object. All objects should have fields for the following data: namelocationThe stationary objects (rooms, trees and walls) are game objects and should have additional fieldsfor the following data: damagePointsThe collectable objects (coins, weapons, and health potions) are game objects and should have additional fields for the following data: valuetype (an enum with choices such COINS, HEALTH_POTION, AXE, SWORD, MACE, MAGIC_WAND, BOMB)The moveable objects are game objects and should have additional fields for the following data: healthdirectionspeedThe bad guy objects (zombies and aliens) are moveable objects and should have additional fields for the following data: meanFactordefeatPointsThe good guy objects (warriers, wizards, and hobbits) are moveable objects and should have additional fields for the following data: strengthintelligencebackPack (ArrayList of collectable objects)The main program (aka test program) should build an ArrayList of stationary objects and an ArrayList of moveable objects. It should build an ArrayList of collectable objects for each good guy’s backpack. The main program should go through all objects in each ArrayList and call their common methods (e.g., display(), move(), fight(), etc.).
Programming Assignment #4._1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Java Restaurant Billing Management System Coursework
|4
|794
|179