Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

java programming language . using Jpanel. Can anyone help me with this assignmen

ID: 3738075 • Letter: J

Question

java programming language . using Jpanel.

Can anyone help me with this assignment, please.

Thank you.

Desian your-own-Version-of-pacman game using suigYour version should deature the core mechanies Arom the orfginal oth atleast one additional our own design ure 0 not nee to and supgest do not implement Com pu ter players egReversi betudeen tuo humorn laers at take turns. Your game on needs to have one level that h/ hlohts of your features However, it should be fally all able: Use freely available araphics bur ovwn images Or by pointna)Tnclude sound etleets tood timages) or make

Explanation / Answer

import javax.swing.JOptionPane;
public class Play {
private int lifes;
private int xAx;
private int yAx;
private String imagePath;
private boolean isAlive;
public int getLifes() {
return lifes;
}
public void setLifes(int lifes) {
this.lifes = lifes;
}
public Play(int lifes, int xAx, int yAx, String imagePath, boolean isAlive) {
super();
this.setLifes(lifes);
this.setAlife(isAlive);
this.setImagePath(imagePath);
this.setxAx(xAx);
this.setyAx(yAx);
}
public int getxAx() {
return xAx;
}
public void setxAx(int xAx) {
this.xAx = xAx;
}
public int getyAx() {
return yAx;
}
public void setyAx(int yAx) {
this.yAx = yAx;
}
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
if(imagePath == null)
JOptionPane.showMessageDialog(null, "Invalid string!");
else if(imagePath.length() == 0)
JOptionPane.showMessageDialog(null, "String Empty");
else
this.imagePath = imagePath;
}
public boolean isAlive() {
return isAlive;
}
public void setAlife(boolean isAlive) {
this.isAlive = isAlive;
}
}
import java.awt.Graphics;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Level1 extends JPanel{
private JFrame window = new JFrame("Packman");
private ImageIcon background = new ImageIcon("images//background.jpg");
public Level1()
{
window.add(this);
window.setSize(950, 540);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setVisible(true);
}
public void paint(Graphics g)
{
g.drawImage(background.getImage(), 0, 0, null);
}
}
public class Exectuable {
public static void main(String[] args) {
Level1 l = new Level1();
}
}