Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, One of your colleagues helped with this Java Project which I really appreciate. However, I would like to know if the XML part was

Hi,

One of your colleagues helped with this Java Project which I really appreciate. However, I would like to know if the XML part was applied:

Here is the solution below:

Intro.java

// import the necessary package.

import javax.swing.*;

import java.awt.event.*;

// Declare the class.

public class Intro extends JPanel {

static JFrame frame;

// Declare the constructor.

public Intro() {

initComponents();

}

@SuppressWarnings("unchecked")

// declare method.

private void initComponents() {

jLabel1 = new JLabel();

mainMap = new JButton();

options = new JButton();

instructions = new JButton();

credits = new JButton();

// Display text message.

jLabel1.setText("Welcome to Game");

// Set the text.

mainMap.setText("Main Map");

// Action listener to the main Map

mainMap.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

mainMapActionPerformed(evt);

}

});

// set the text and call the action listener

options.setText("Options");

options.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

optionsActionPerformed(evt);

}

});

// set the text and call the action listener

instructions.setText("Instructions");

instructions.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

instructionsActionPerformed(evt);

}

});

// set the text and call the action listener

credits.setText("Credits");

credits.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

creditsActionPerformed(evt);

}

});

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(157, 157, 157).addComponent(jLabel1))

.addGroup(layout.createSequentialGroup().addContainerGap().addComponent(mainMap)

.addGap(37, 37, 37).addComponent(options).addGap(35, 35, 35)

.addComponent(instructions).addGap(39, 39, 39).addComponent(credits)))

.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(45, 45, 45).addComponent(jLabel1).addGap(52, 52, 52)

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(mainMap)

.addComponent(options).addComponent(instructions).addComponent(credits))

.addContainerGap(36, Short.MAX_VALUE)));

}

// Definition of the method.

private void mainMapActionPerformed(ActionEvent evt) {

Intro.frame.dispose();

new MainMap(Intro.frame);

}

// definition of the method.

private void creditsActionPerformed(ActionEvent evt) {

Intro.frame.dispose();

new CreditsPanel(Intro.frame);

}

// definition of the method.

private void instructionsActionPerformed(ActionEvent evt) {

Intro.frame.dispose();

new InstructionsPanel(Intro.frame);

}

// definition of the method.

private void optionsActionPerformed(ActionEvent evt) {

Intro.frame.dispose();

new OptionsPanel(Intro.frame);

}

// Start the main method.

public static void main(String[] args) {

frame = new JFrame();

frame.setContentPane(new Intro());

frame.setSize(500, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Game Introduction");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

// declare variables.

private JButton credits;

private JButton instructions;

private JLabel jLabel1;

private JButton mainMap;

private JButton options;

}

MainMap.java

//import the necessary package.

import javax.swing.*;

import java.awt.event.*;

//Declare the class.

public class MainMap extends JPanel {

JFrame introScreen;

JFrame frame;

// Declare the constructor.

public MainMap(JFrame introScreen) {

this.introScreen = introScreen;

frame = new JFrame();

frame.setContentPane(this);

frame.setSize(500, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Main Game");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

initComponents();

}

@SuppressWarnings("unchecked")

// declare method.

private void initComponents() {

jButton1 = new JButton();

jButton2 = new JButton();

jButton3 = new JButton();

jButton5 = new JButton();

jButton6 = new JButton();

// Set the text and call the action listener

jButton1.setText("Game 1");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

// Set the text and call the action listener

jButton2.setText("Game 2");

jButton2.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton2ActionPerformed(evt);

}

});

// Set the text and call the action listener

jButton3.setText("Game 3");

jButton3.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton3ActionPerformed(evt);

}

});

// Set the text and call the action listener

jButton5.setText("Go Home");

jButton5.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton5ActionPerformed(evt);

}

});

// Set the text and call the action listener

jButton6.setText("Game Over");

jButton6.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton6ActionPerformed(evt);

}

});

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jButton1)

.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addComponent(jButton5).addGap(35, 35, 35)

.addComponent(jButton6).addGap(0, 0, Short.MAX_VALUE))

.addGroup(layout.createSequentialGroup().addComponent(jButton2).addGap(18, 18, 18)

.addComponent(jButton3).addGap(18, 18, 18)

.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,

GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))

.addContainerGap()));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(80, 80, 80)

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)

.addComponent(jButton1).addComponent(jButton2).addComponent(jButton3))

.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(jButton5)

.addComponent(jButton6)).addContainerGap(44, Short.MAX_VALUE)));

}

// Definition of the method.

private void jButton1ActionPerformed(ActionEvent evt) {

frame.setVisible(false);

new Game1(frame);

}

// Definition of the method.

private void jButton5ActionPerformed(ActionEvent evt) {

frame.dispose();

introScreen.setVisible(true);

}

// Definition of the method.

private void jButton2ActionPerformed(ActionEvent evt) {

frame.setVisible(false);

new Game2(frame);

}

// Definition of the method.

private void jButton3ActionPerformed(ActionEvent evt) {

frame.setVisible(false);

new Game3(frame);

}

// Definition of the method.

private void jButton6ActionPerformed(ActionEvent evt) {

frame.setVisible(false);

new GameOver(frame);

}

// Declare variables.

private JButton jButton1;

private JButton jButton2;

private JButton jButton3;

private JButton jButton5;

private JButton jButton6;

}

Game1.java

//import the necessary package.

import javax.swing.*;

import java.awt.event.*;

public class Game1 extends JPanel {

JFrame mainFrame;

JFrame frame;

// Declare the constructor.

public Game1(JFrame mainFrame) {

this.mainFrame = mainFrame;

frame = new JFrame();

frame.setContentPane(this);

frame.setSize(300, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Game 1");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

initComponents();

}

@SuppressWarnings("unchecked")

private void initComponents() {

jButton1 = new JButton();

jLabel1 = new JLabel();

// Set the text and call the action listener

jButton1.setText("Main Map");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

jLabel1.setText("Game 1 will be here");

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(58, 58, 58)

.addComponent(jButton1))

.addGroup(layout.createSequentialGroup().addGap(47, 47, 47).addComponent(jLabel1)))

.addContainerGap(260, Short.MAX_VALUE)));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(44, 44, 44).addComponent(jLabel1).addGap(33, 33, 33)

.addComponent(jButton1).addContainerGap(186, Short.MAX_VALUE)));

}

// Definition of the method.

private void jButton1ActionPerformed(ActionEvent evt) {

frame.dispose();

mainFrame.setVisible(true);

}

// Declare variables.

private JButton jButton1;

private JLabel jLabel1;

}

Game2.java

//import the necessary package.

import javax.swing.*;

import java.awt.event.*;

public class Game2 extends JPanel {

JFrame mainFrame;

JFrame frame;

// Declare the constructor.

public Game2(JFrame mainFrame) {

this.mainFrame = mainFrame;

frame = new JFrame();

frame.setContentPane(this);

frame.setSize(300, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Game 2");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

initComponents();

}

@SuppressWarnings("unchecked")

private void initComponents() {

jButton1 = new JButton();

jLabel1 = new JLabel();

// Set the text and call the action listener

jButton1.setText("Main Map");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

jLabel1.setText("Game 2 will be here");

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(58, 58, 58)

.addComponent(jButton1))

.addGroup(layout.createSequentialGroup().addGap(47, 47, 47).addComponent(jLabel1)))

.addContainerGap(260, Short.MAX_VALUE)));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(44, 44, 44).addComponent(jLabel1).addGap(33, 33, 33)

.addComponent(jButton1).addContainerGap(186, Short.MAX_VALUE)));

}

// Definition of the method.

private void jButton1ActionPerformed(ActionEvent evt) {

frame.dispose();

mainFrame.setVisible(true);

}

// Declare variables.

private JButton jButton1;

private JLabel jLabel1;

}

Game3.java

//import the necessary package.

import javax.swing.*;

import java.awt.event.*;

public class Game3 extends JPanel {

JFrame mainFrame;

JFrame frame;

// Declare the constructor.

public Game3(JFrame mainFrame) {

this.mainFrame = mainFrame;

frame = new JFrame();

frame.setContentPane(this);

frame.setSize(300, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Game 3");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

initComponents();

}

private void initComponents() {

jButton1 = new JButton();

jLabel1 = new JLabel();

// Set the text and call the action listener

jButton1.setText("Main Map");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

jLabel1.setText("Game 3 will be here");

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(58, 58, 58)

.addComponent(jButton1))

.addGroup(layout.createSequentialGroup().addGap(47, 47, 47).addComponent(jLabel1)))

.addContainerGap(260, Short.MAX_VALUE)));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(44, 44, 44).addComponent(jLabel1).addGap(33, 33, 33)

.addComponent(jButton1).addContainerGap(186, Short.MAX_VALUE)));

}

// Definition of the method.

private void jButton1ActionPerformed(ActionEvent evt) {

frame.dispose();

mainFrame.setVisible(true);

}

// Declare variables.

private JButton jButton1;

private JLabel jLabel1;

}

GameOver.java

//import the necessary package.

import javax.swing.*;

import java.awt.event.*;

public class GameOver extends JPanel {

JFrame mainFrame;

JFrame frame;

// Declare the constructor.

public GameOver(JFrame mainFrame) {

this.mainFrame = mainFrame;

frame = new JFrame();

frame.setContentPane(this);

frame.setSize(300, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Game 1");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

initComponents();

}

private void initComponents() {

jButton1 = new JButton();

jLabel1 = new JLabel();

// Set the text and call the action listener

jButton1.setText("Main Map");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

jLabel1.setText("Game Over Panel");

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(58, 58, 58)

.addComponent(jButton1))

.addGroup(layout.createSequentialGroup().addGap(47, 47, 47).addComponent(jLabel1)))

.addContainerGap(265, Short.MAX_VALUE)));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(44, 44, 44).addComponent(jLabel1).addGap(33, 33, 33)

.addComponent(jButton1).addContainerGap(186, Short.MAX_VALUE)));

}

// Definition of the method.

private void jButton1ActionPerformed(ActionEvent evt) {

frame.dispose();

mainFrame.setVisible(true);

}

// Declare variables.

private JButton jButton1;

private JLabel jLabel1;

}

OptionsPanel.Java

//import the necessary package.

import javax.swing.*;

import java.awt.event.*;

public class OptionsPanel extends JPanel {

JFrame introScreen;

JFrame frame;

// Declare the constructor.

public OptionsPanel(JFrame introScreen) {

this.introScreen = introScreen;

frame = new JFrame();

frame.setContentPane(this);

frame.setSize(300, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Game Options");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

initComponents();

}

private void initComponents() {

jLabel1 = new JLabel();

jButton1 = new JButton();

jLabel1.setText("Options Screen");

// Set the text and call the action listener

jButton1.setText("Go Home");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(

layout.createSequentialGroup().addGap(99, 99, 99)

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(15, 15, 15)

.addComponent(jLabel1))

.addComponent(jButton1))

.addContainerGap(213, Short.MAX_VALUE)));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(60, 60, 60).addComponent(jLabel1).addGap(18, 18, 18)

.addComponent(jButton1).addContainerGap(185, Short.MAX_VALUE)));

}

// Definition of the method.

private void jButton1ActionPerformed(ActionEvent evt) {

frame.dispose();

introScreen.setVisible(true);

}

// Declare variables.

private JButton jButton1;

private JLabel jLabel1;

}

InstructionsPanel.java

//import the necessary package.

import javax.swing.*;

import java.awt.event.*;

public class InstructionsPanel extends JPanel {

JFrame introScreen;

JFrame frame;

// Declare the constructor.

public InstructionsPanel(JFrame introScreen) {

this.introScreen = introScreen;

frame = new JFrame();

frame.setContentPane(this);

frame.setSize(300, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Game Instructions");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

initComponents();

}

private void initComponents() {

jButton1 = new JButton();

jLabel1 = new JLabel();

// Set the text and call the action listener

jButton1.setText("Go Home");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

jLabel1.setText("Instructions");

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(97, 97, 97)

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addComponent(jButton1).addGroup(layout.createSequentialGroup()

.addGap(19, 19, 19).addComponent(jLabel1)))

.addContainerGap(100, Short.MAX_VALUE)));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(55, 55, 55).addComponent(jLabel1).addGap(42, 42, 42)

.addComponent(jButton1).addContainerGap(69, Short.MAX_VALUE)));

}

// Definition of the method.

private void jButton1ActionPerformed(ActionEvent evt) {

frame.dispose();

introScreen.setVisible(true);

}

// Declare variables.

private JButton jButton1;

private JLabel jLabel1;

}

CreditsPanel.java

//import the necessary package.

import javax.swing.*;

import java.awt.event.*;

public class CreditsPanel extends JPanel {

JFrame introScreen;

JFrame frame;

// Declare the constructor.

public CreditsPanel(JFrame introScreen) {

this.introScreen = introScreen;

frame = new JFrame();

frame.setContentPane(this);

frame.setSize(300, 200);

frame.setLocationRelativeTo(null);

frame.setVisible(true);

frame.setTitle("Game Credits");

frame.setResizable(false);

frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

initComponents();

}

@SuppressWarnings("unchecked")

private void initComponents() {

jLabel1 = new JLabel();

jButton1 = new JButton();

jLabel1.setText(" Game Credits");

// Set the text and call the action listener

jButton1.setText("Go Home");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

// Set the layout of the panel.

GroupLayout layout = new GroupLayout(this);

this.setLayout(layout);

layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(109, 109, 109)

.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)

.addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 82,

GroupLayout.PREFERRED_SIZE)

.addComponent(jButton1))

.addContainerGap(91, Short.MAX_VALUE)));

layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup().addGap(37, 37, 37)

.addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 44,

GroupLayout.PREFERRED_SIZE)

.addGap(18, 18, 18).addComponent(jButton1).addContainerGap(44, Short.MAX_VALUE)));

}

// Definition of the method.

private void jButton1ActionPerformed(ActionEvent evt) {

frame.dispose();

introScreen.setVisible(true);

}

// Declare variables.

private JButton jButton1;

private JLabel jLabel1;

}

Explanation:

output of code:

However, I wanted make sure that the below requirement for XML was included in the code before I submit it:

Integrate an understanding of XML and apply this understanding to Java.

Deliverables

.javafiles as requested below

XML files

XML

The text of the questions and of the final ranking should be kept in a file and read when needed. You have to use what you learned in the XML lesson to read and write the file.XMLis the required format, and it should be used as explained in the lesson.

Please see attachment for the entire requirement and the output...

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
AutoSave . Off) H ~ ~ A) = Document7 - Word Search A Michael Owusu-Scott MO X File Home Insert Design Layout References Mailings Review View Help Share Comments & Cut Find LO Copy Helvetica Neue ~ 30 ~ A A Aa~ A EF SENT AaBbCCD AaBbCCD AAB AaBb AaBbC, AaBbCCD AdB AaBbCCC AaBbCCDt AQBbCCDt AQBbCCD AaBbCCD( AaBbCCD AaBbCCD AABBCCD AABBCCDL AaBbCCD AaBbCCDc Replace Paste Format Painter BIU axxALABEL. 1 Normal 1 No Spac... Heading 1 Heading 2 Heading 3 Heading 4 Title Subtitle Subtle Em.. Emphasis Intense E... Strong Quote Intense Q. Subtle Ref.. Intense Re. Book Title 1 List Para. Dictate Editor Select v Clipboard Font Paragraph Styles Editing Voice Editor As the character enters a campus, a new panel should show up. The panel will have All the projects: Final Group Project Overview either have one or more questions, or a challenge (a puzzle or a game). When the answer is given or the challenge is over, the character should be put back on the main Have to start the basic class with the main method. It will create a JErame. map screen where he/she was last. You should keep score of the character's specified below. What Will Be Accomplished performance to use it in the final ranking. Will have their own JEcame extending from Java's JEcame. This JErame will create a JPanel specified below. The Character Will have their own JPanel extending from Java's JPanel Develop, test, and execute a graphic application for simulations using Java. Create a Java application. The character has to be picked from a list of three choices. Each choice should make Given a set of events, choose the appropriate programming he character different; for instance, it might move faster, it might, more or less, be able Java Code actions. to answer the questions, or have more or less speed or strength when he/she plays the It has to be based on the examples given in class and in the textbook. If you intend to Work with Java in a way that demonstrates understanding of the games at each campus. use advanced code, clear it with the instructor first. principles behind the programming language. Demonstrate understanding of the principles of object-oriented programming The Character's Movement Suggestions ncluding classes and inheritance. Integrate an understanding of XML and apply this understanding to Java The character will be moved using the keyboard. When the character gets close or on Use inheritance where appropriate. Use parameters to reuse code. For instance, the top of the campus, the campus panel should appear and the campus game should be Questions panel might use one panel class that receives different parameters (number Deliverables eady to be played. of questions, name of the file with the questions, theme). Use the course examples and The character should have an icon representing the user choice. your own labs to get started. Start simple: start with something you might be more comfortable with. It might be the main screen, the character movement, or creating one .java files as requested below The Theme questions/answers panel. Try to follow the lesson's examples and standards XML files The user might choose from three different options for a game theme. For instance, the Basic Requirements theme might be Penn State football and the questions and games will be themed around that. Also, the theme might be Math and the questions and puzzles will regard The final project: a game. It will be based on the Pennsylvania State University system. Math. The theme options are your choice A character (a student, a football player, a famous Penn State icon, etc.) will walk around the state of Pennsylvania and enter five campuses, one at a time. At each Game Over campus, the character will face challenges such as answering questions, solving a puzzle, or playing a game. The character will collect points in each location. After the When the character has entered and interacted with five campuses, the game is over five campus visits, the game will end. Then, a final screen will be shown, displaying the and a final screen with the character's ranking should be displayed. character's rankings according to his/her performance. XML Detailed Requirements The text of the questions and of the final ranking should be kept in a file and read when The Map needed. You have to use what you learned in the XML lesson to read and write the file. XML is the required format, and it should be used as explained in the lesson. The character will move on a map. It could be a sketch built with graphics (panels, buttons, etc.,) and a picture background. The Timer The application has to have more than five campuses, so the user must have a choice The time (duration of game play) should be kept, displayed at all times (you might use a of where to go. Find a creative way to represent World Campus: it could be a special progress bar, for instance), and be part of the final ranking. You might choose to give a key or place for the character to enter World Campus. In order to enter the other time limit and require players to enter five campuses before the time limit is reached. A campuses, the character has to be moved over the campus position on the screen. final screen with the score, time, and ranking should be shown. The Campuses Class Structure Page 1 of 3 794 words Focus 8 0 100% 9:35 PM Type here to search O ~ 0 4) 2 11/24/2020\f\f\f

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books