https://github.com/ci-wdi-900/pong

1 answer below »
https://github.com/ci-wdi-900/pong
Answered Same DayNov 02, 2021

Answer To: https://github.com/ci-wdi-900/pong

Shashi Kant answered on Nov 03 2021
130 Votes
pong/Readme.txt
This is Pong Game, here two player will play and both of them have to save thier boundry, the ball should not touch the player's boundry.
Opponent player will try to hit on your boundry with the BALL all you have to do is save with the help of PADDLE.
Here Main file is "Main.Java", You have to compile this file with the help of s
ome command which you have to write on your terminal.
Command:-
        javac Main.java
This command will compile all the files and will create the class for the files.
Now you to run the file with another command.
Command:-
        java Main
Now you will be able to see the UI where you can play the game and control the game.
Since it's a multiplayer game so for both of you will have diffrent-diffrent control.
For Player1 which is left side on the screen can control the game with "W" and "S".
For Player2 which is right side on the screen can control the game with "Up Key" and "Down Key'.
There will be 10 points, whoever get the 10 points first will WIN the Game and at the end the of game, it will display a message (Who WON and what were the points for both of the player) and the game will be close.
pong/src/Score.class
public synchronized class Score extends java.awt.Rectangle {
static int GAME_WIDTH;
static int GAME_HEIGHT;
int player1;
int player2;
void Score(int, int);
public void draw(java.awt.Graphics);
}
pong/src/Ball.class
public synchronized class Ball extends java.awt.Rectangle {
java.util.Random random;
int xVelocity;
int yVelocity;
int initialSpeed;
void Ball(int, int, int, int);
public void setXDirection(int);
public void setYDirection(int);
public void move();
public void draw(java.awt.Graphics);
}
pong/src/Paddle.class
public synchronized class Paddle extends java.awt.Rectangle {
int id;
int yVelocity;
int speed;
void Paddle(int, int, int, int, int);
public void keyPressed(java.awt.event.KeyEvent);
public void keyReleased(java.awt.event.KeyEvent);
public void setYDirection(int);
public void move();
public void draw(java.awt.Graphics);
}
pong/src/GamePanel.class
public synchronized class GamePanel extends javax.swing.JPanel implements Runnable {
static final int SCREEN_WIDTH = 1100;
static final int SCREEN_HEIGHT = 611;
static final java.awt.Dimension SCREEN_SIZE;
static final int BALL_SIZE = 20;
static final int PADDLE_WIDTH = 18;
static final int PADDLE_HEIGHT = 100;
Thread gameThread;
java.awt.Image image;
java.awt.Graphics graphics;
java.util.Random random;
Paddle paddle1;
Paddle paddle2;
Ball ball;
Score score;
void GamePanel();
public void newBall();
public void newPaddles();
public void paint(java.awt.Graphics);
public void draw(java.awt.Graphics);
public void move();
public void checkCollision();
public void run();
static void ();
}
pong/src/GamePanel$AL.class
public synchronized class GamePanel$AL extends java.awt.event.KeyAdapter {
public void GamePanel$AL(GamePanel);
public void keyPressed(java.awt.event.KeyEvent);
public void keyReleased(java.awt.event.KeyEvent);
}
pong/src/GameFrame.class
public synchronized class GameFrame extends javax.swing.JFrame {
GamePanel panel;
void GameFrame();
}
pong/src/Main.class
public synchronized class Main {
public void Main();
public static void...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here