Skip to content

Instantly share code, notes, and snippets.

@Srushtika
Created June 11, 2020 12:33
Show Gist options
  • Save Srushtika/f0198c3b7d673daaa98c4abe444ab228 to your computer and use it in GitHub Desktop.
Save Srushtika/f0198c3b7d673daaa98c4abe444ab228 to your computer and use it in GitHub Desktop.
Code snippet 31- For multiplayer space invaders article
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Space Invaders</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Multiplayer space invaders" />
<link
id="favicon"
rel="icon"
href="https://glitch.com/edit/favicon-app.ico"
type="image/x-icon"
/>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
crossorigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=VT323&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="/style.css" />
</head>
<body class="intro-body">
<img
alt="Space invaders"
width="580"
height="250"
src="https://s3.amazonaws.com/files.ably.io/tutorials/multiplayer-space-invaders/headerAbly.png"
/>
<div class="game-instructions">
<p>
Use the arrow keys on your keyboard to move your avatar left or right to
escape the bullets from the spaceship.<br />
Your goal is to make it to the other side, alive!
</p>
</div>
<div class="input-group nickname-input">
<input
type="text"
class="form-control"
placeholder="Enter your nickname"
aria-label="Enter your nickname"
aria-describedby="basic-addon2"
id="nickname"
/>
<div class="input-group-append">
<a href="gameplay">
<span class="input-group-text" id="go-span" onclick="setNickname()"
>GO
</span>
</a>
</div>
</div>
<img
alt="Invader avatars"
width="60%"
height="300"
src="https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Fallinvaders.png?v=1589884216800"
/>
<script src="/nickname.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment