Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Pong Game javascript #770

Merged
merged 6 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/Games/Pong_Game/game.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ping Pong</title>
<link href="./style.css" rel="stylesheet" />
</head>

<body>

<noscript>Your browser does not support JavaScript!</noscript>

<br>
<br>

<center><p style="color: white;">Ping Pong- Multiplayer</p></center><p></p>

<div class="canvas-container">
<p class="left">0</p>
<div class="wrapper">
<canvas id="container"></canvas>
</div>
<p class="right">0</p>
</div>

<div class="small-device">
<p>This game is currently not supported in mobile.</p>
</div>

<script src="./script.js"></script>
</body>

</html>
52 changes: 52 additions & 0 deletions src/Games/Pong_Game/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ping Pong-Multiplayer</title>
<script>
function newLocation() {
window.location.href="game.html";
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&display=swap');

*{
padding:0;
margin: 0;
box-sizing: border-box;
}

body{
height: 100vh;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background: black;
color:white;
font-family: 'Cinzel', serif;
}

button{
font-family: 'Cinzel', serif;
padding:10px 15px;
font-size: 24px;
background: black;
border: 1px solid white;
color: white;
cursor: pointer;
}
</style>
</head>
<body>
<h1><b>Ping-Pong Multiplayer</b></h1>
<br>
<p>Use paddles to drive the volley towards your opponent back and forth.</p>
<br>
<button onclick="newLocation()">Start</button>
</body>
</html>
Loading