Question

Write a JAVA program that plays a simple Pac-man game. The game plays on a 10...

Write a JAVA program that plays a simple Pac-man game. The game plays on a 10 by 10 grid (absolutely, you can make it bigger). Pac-man is depicted as “#” and others as “*”. Please see the below.  
You should ask how many pac-man plays before starting the game. Then, you should create the number of pac-man objects. The pac-mans are defined as classes, and the objects are stored in an array. The pac-man class has a “move()” method, which randomly moves one square in any direction but not diagonally. The movement should be within the grid. The “move()” method will be called at a time intervals (e.g., 0.5 second).  
The pac-man starts to move from the top-left corner. The game ends if a pac-man reaches the bottom-right corner or if it repeats more than a certain times (e.g., 1000). Please check “PacmanGame.jar”. You can run the program, “java -jar PacmanGame.jar”.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the Snapshot for the Game Pacman below:-

Please find all the Java classes and images/icons zipped as per the link below from where it can be downloaded:-

https://drive.google.com/file/d/19OvIU2xFtfWFmhxmjRY6ImPlQg5XKpd2/view

NOTE:- Before running this game, please create a package named "pacman" and place all the Java files and images under the package created and run via UI.java. Enjoy!!

Please let me know in case of any clarifications required. Thanks!

Add a comment
Know the answer?
Add Answer to:
Write a JAVA program that plays a simple Pac-man game. The game plays on a 10...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a JAVA program that plays a number guessing game with the user. A sample run...

    Write a JAVA program that plays a number guessing game with the user. A sample run for the game follows. User input is shown in boldface in the sample run. Welcome to the game of Guess It! I will choose a number between 1 and 100. You will try to guess that number. If your guess wrong, I will tell you if you guessed too high or too low. You have 6 tries to get the number. OK, I am...

  • *3.17 (Game: scissor, rock, paper) Write a JAVA program that plays the popular scissor-rock-paper game. (A...

    *3.17 (Game: scissor, rock, paper) Write a JAVA program that plays the popular scissor-rock-paper game. (A scissor can cut a paper, a rock can knock a scissor, and a paper can wrap a rock.) The program randomly generates a number 0, 1, or 2 representing scissor, rock, and paper. The program prompts the user to enter a number 0, 1, or 2 and displays a message indicating whether the user or the computer wins, loses, or draws ** Have to...

  • You will write a Java program that implements Conway’s Game of Life, a simple cellular automaton...

    You will write a Java program that implements Conway’s Game of Life, a simple cellular automaton discussed in class. See for example: http://www.bitstorm.org/gameoflife/ Our version has a 10 x 10 grid, numbered like this: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 The grid is represented by a 10 x 10 2­dimensional integer array. If the grid point (i, j) is "populated", the array element [i][j] contains 1;...

  • Write a Java application program that plays a number guessing game with the user. In the...

    Write a Java application program that plays a number guessing game with the user. In the starter code that you are given to help you begin the project, you will find the following lines of code: Random generator = args.length == 0 ? new Random() :                    new Random(Integer.parseInt(args[0])); int secret = generator.nextInt(100); You must keep these lines of code in your program. If you delete these lines, or if you change thse lines in any way, then your program...

  • Intro to Java. Can someone please help me answer this question. Create a java program playing...

    Intro to Java. Can someone please help me answer this question. Create a java program playing the game of craps with a random number generator. Write a method craps that plays the game of craps and it should return a 1 representing a win, a 2 representing a loss, and a 0 representing the need to toss the pair of dice again. The main method should ask how many games you wish to play then call the method craps. Main...

  • Battle Ship Game Write a Java program from scratch. Simple geometrical reasoning is at the core...

    Battle Ship Game Write a Java program from scratch. Simple geometrical reasoning is at the core of Battleships. One important notion is adjacency, with two sub-types: edge adjacency and corner adjacency. For example, the square (4,3) is edge-adjacent to the square (3,3), it is corner-adjacent to the square (3,2), and it is not adjacent to the square (6,7). Write a program that reads a square from the user, and prints out three lists(each with a seperate method): 1) a list...

  • JAVA Program The Game This is a simple game played on a linear board with squares...

    JAVA Program The Game This is a simple game played on a linear board with squares numbered from 0 to 100. The player starts at position 0, and the object of the game is to land on position 100 exactly. Objectives By the end of this program, the student will have demonstrated the ability to Write static methods Call a static method in another class Pass parameters to a method Return values from a method Write loops Write if statements...

  • For this lab you will write a Java program that plays the dice game High-Low. In...

    For this lab you will write a Java program that plays the dice game High-Low. In this game a player places a bet on whether the sum of two dice will come up High (totaling 8 or higher), Low (totaling 6 or less) or Sevens (totaling exactly 7). If the player wins, they receive a payout based on the schedule given in the table below: Choice Payout ------ ------ High 1 x Wager Low 1 x Wager Sevens 4 x...

  • 1 Overview For this assignment you are required to write a Java program that plays (n,...

    1 Overview For this assignment you are required to write a Java program that plays (n, k)-tic-tac-toe; (n, k)-tic- tac-toe is played on a board of size n x n and to win the game a player needs to put k symbols on adjacent positions of the same row, column, or diagonal. The program will play against a human opponent. You will be given code for displaying the gameboard on the screen. 2 The Algorithm for Playing (n, k)-Tic-Tac-Toe The...

  • Please write a recursive Java program to solve the Tower of Hanoi game for n disks...

    Please write a recursive Java program to solve the Tower of Hanoi game for n disks on pole A. Please read the textbook page 176 – 180 to fully understand this game or puzzle. The game consists of n disks and three poles: A (the source), B (the destination), and C (the spare). Initially, all the disks are on pole A. The game is to move all disks (one by one) from pole A to pole B using pole C...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT