
Patrick B. answered 05/21/21
Math and computer tutor/teacher
Either you or someone else has already posted this project,
which is WAY TOO BIG and WAY TOO COMPLICATED to be posted here.
The long term final result is
xMax - (x1+x2+x3 + ... xn) where
xMax is the greatest strength owned by the hero and
x1,x2,..xN are the strength values of the other monsters and heros..
For example:
Hero1: 1500
Hero2 : 800
Monster 1: 10
Monster 2: 5
then the winner shall be Hero 1 with strength value =
1500 - (800+10+5) =
1500 - 815 =
685
This is because they will eventually collide and when they due,
the strength values will cancel, leaving the largest value minus
these differences.
From the OOP standpoint, I would suggest the following:
Base class called Player or GameCharacter
with data members strength value and name.
Monster inherits directly from GameCharacter with no additional
data members
Hero inherits from GameCharacter with an additional data member
for the # of gold pieces.
The GAME board is a 2-D array of ArrayList<GameCharacter>
That is, each cell in the game board is, in and of itself,
is an ArrayList which contains an GameCharacter objects (typecast
as either Hero or Monster)
I believe I may have some code lying around, so shoot me an email.