View filterWithHive-Lambda.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//code from the lambda function | |
const request = require("request"); | |
const axios = require("axios"); | |
const ABLY_API_KEY = "<YOUR-ABLY-API-KEY>"; | |
let textData = ""; | |
let originalData; | |
let originalMessagePayload; | |
const publishMessageToAbly = async (textData, originalData, msgTimestamp) => { |
View gameover.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let winner = localStorage.getItem("winner"); | |
let firstRunnerUp = localStorage.getItem("firstRunnerUp"); | |
let secondRunnerUp = localStorage.getItem("secondRunnerUp"); | |
let totalPlayers = localStorage.getItem("totalPlayers"); | |
document.getElementById("winner-announcement").innerHTML = | |
winner + " won the game!"; | |
if (firstRunnerUp) { | |
document.getElementById("first-runnerup").innerHTML = |
View winner.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let winner = localStorage.getItem("winner"); | |
let firstRunnerUp = localStorage.getItem("firstRunnerUp"); | |
let secondRunnerUp = localStorage.getItem("secondRunnerUp"); | |
let totalPlayers = localStorage.getItem("totalPlayers"); | |
document.getElementById("winner-announcement").innerHTML = | |
winner + " won the game!"; | |
if (firstRunnerUp) { | |
document.getElementById("first-runnerup").innerHTML = |
View nickname.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let nickname = ""; | |
let nicknameInput = document.getElementById("nickname"); | |
function setNickname() { | |
localStorage.clear() | |
nickname = nicknameInput.value; | |
localStorage.setItem("nickname", nickname); | |
} | |
if(nicknameInput){ |
View gameover.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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" |
View winner.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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" |
View intro.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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" |
View gameRoomFull.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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" |
View script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
publishMyDeathNews(bullet, avatar) { | |
if (amIalive) { | |
deadPlayerCh.publish("dead-notif", { | |
killerBulletId: bulletThatShotMe, | |
deadPlayerId: myClientId, | |
}); | |
} | |
amIalive = false; | |
} |
View explosion.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Explosion extends Phaser.GameObjects.Sprite { | |
constructor(scene, x, y) { | |
super(scene, x, y, "explosion"); | |
scene.add.existing(this); | |
this.play("explode"); | |
} | |
} |
NewerOlder