Programming Assignment #4.

Added on -2019-09-16

| 2 pages
| 368 words
| 384 views

Trusted by 2+ million users,
1000+ happy students everyday

Showing pages 1 to 1 of 2 pages

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.).

Found this document preview useful?

You are reading a preview
Upload your documents to download
or
Become a Desklib member to get accesss

Students who viewed this