please review the info belowUpload your .java file(s) to Ecampus or Present the program to the class or demo to instructor during open

please review the info below

Upload your .java file(s) to Ecampus or Present the program to the class or demo to instructor during open lab.

Complete your game that was begun in Homework 4.  The game should be in a single file.  It should have the following components:

1.  An original theme
2.  Introduction screen with color ASCII art and text describing your game and theme
3.  Ending screens for player win and lose
4.  Enemies should be moved into an ArrayList
5.  Enemies can attack the player and vice versa
6.  Enemies will move toward the player
7.  A variety of Items should be added to your World such as health power-ups

Here is some code that will help:

// create an ArrayList of Enemy class and add some objects

// this belongs at the top of your program after you have created your player object

ArrayList<Enemy> Enemies =
new
ArrayList<Enemy>();

Enemies.add(
new Enemy(“Orc”));

Enemies.add(
new Enemy(“Dragon”));

// step through Enemy ArrayList and attack if adjacent to player

// this belongs in the gameloop after the player has moved

for (int i=0; i<Enemies.size(); i++)

{

if ((Enemies.get(i).Ypos == P.Ypos && (Enemies.get(i).Xpos == P.Xpos+1)) || // player is to the left

(Enemies.get(i).Ypos == P.Ypos && (Enemies.get(i).Xpos == P.Xpos-1)) || // player is to the right

(Enemies.get(i).Xpos == P.Xpos && (Enemies.get(i).Ypos == P.Ypos+1)) ||  // player is above

(Enemies.get(i).Xpos == P.Xpos && (Enemies.get(i).Ypos == P.Ypos-1))) // player is below

{

Enemies.get(i).HP -= P.Attack; // Player attacks Enemy

P.HP -= Enemies.get(i).Attack; // Enemy attacks Player

// Here is a more advanced attack formula that utilizes attack and armor values.

// P.HP -= (100 * Enemy.get(i).Attack) / (100 + P.Armor)

if (Enemies.get(i).HP <= 0) // Enemy dies

{

P.World[Enemies.get(i).Xpos][Enemies.get(i).Ypos] = ‘ ‘;

Enemies.remove(i);

}

}

}

// step through Enemy ArrayList and move towards the player

// optionally add a range variable so enemies only move towards player if within range

for (int i=0; i<Enemies.size(); i++)

{

if (Enemies.get(i).Xpos > P.Xpos)

Enemies.get(i).MoveLeft();

else

Enemies.get(i).MoveRight();

if (Enemies.get(i).Ypos > P.Ypos)

Enemies.get(i).MoveUp();

else

Enemies.get(i).MoveDown();

}

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

SQL helpExercise 8: Write your SQL statement in a file named CIS276DA_Lesson3Exercise8_MEID.sql. Run the script and export the results to

SQL help Exercise 8: Write your SQL statement in a file named CIS276DA_Lesson3Exercise8_MEID.sql. Run the script and export the results to CIS276DA_Lesson3Exercise8_MEID.csv. Exercise 9: Write your SQL statement in a file named CIS276DA_Lesson3Exercise9_MEID.sql. Run the script and export the results to CIS276DA_Lesson3Exercise9_MEID.csv. Exercise 10: Write your SQL statement in a

An interrupt occurs. Data transfer for the current application completes. Execute kernel function in kernel mode. Transfer execution to

An interrupt occurs. Data transfer for the current application completes. Execute kernel function in kernel mode. Transfer execution to another application. An interrupt occurs. Block the current application. Data transfer for the current application completes. Transfer execution from another application back to the kernel in kernel mode. this are the option give me the

Project 1: Develop Cloud Migration Plan  Step 4: Install AWS Application Discovery Agent  At this point in the migration planning process, you’ve

Project 1: Develop Cloud Migration Plan  Step 4: Install AWS Application Discovery Agent  At this point in the migration planning process, you’ve considered premigration issues, reviewed premigration assessment tools, and familiarized yourself with AWS Application Discovery Services. You are now ready to install and test the AWS Application Discovery Agent.