Skip to content

Commit 5fd5cc8

Browse files
author
Gustavo Kazuya Oshiro
committed
initial commit
0 parents  commit 5fd5cc8

13 files changed

+9661
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[Makefile]
12+
indent_size = 4
13+
indent_style = tab

.eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.idea/
2+
/.vscode/
3+
/bundle/
4+
/dist/
5+
/node_modules/
6+
/reports/
7+
/.cache/

.eslintrc.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint", "spellcheck", "import", "jest"],
5+
"extends": [
6+
"eslint:recommended",
7+
"plugin:@typescript-eslint/eslint-recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"prettier/@typescript-eslint",
10+
"plugin:prettier/recommended",
11+
"plugin:import/errors",
12+
"plugin:import/warnings",
13+
"plugin:import/typescript"
14+
],
15+
"parserOptions": {
16+
"ecmaVersion": 2019,
17+
"sourceType": "module",
18+
"project": "./tsconfig.json"
19+
},
20+
"settings": {
21+
"import/resolver": {
22+
"node": {
23+
"extensions": [".ts"],
24+
"moduleDirectory": ["node_modules"],
25+
"paths": ["node_modules/@types"]
26+
}
27+
}
28+
},
29+
"rules": {
30+
"@typescript-eslint/ban-types": "off",
31+
"@typescript-eslint/no-inferrable-types": "off",
32+
"jest/no-focused-tests": "error"
33+
}
34+
}

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.idea/
2+
/.vscode/
3+
/bundle/
4+
/dist/
5+
/function.zip
6+
/node_modules/
7+
/reports/
8+
/.cache/

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"trailingComma": "all",
3+
"printWidth": 80,
4+
"tabWidth": 2,
5+
"singleQuote": false,
6+
"semi": true,
7+
"bracketSpacing": true,
8+
"arrowParens": "always"
9+
}

.tool-versions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 14.17.0

client/game.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Pong</title>
5+
</head>
6+
<body>
7+
<div id="ui"></div>
8+
<script src="./game.ts"></script>
9+
</body>
10+
</html>

client/game.ts

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import {
2+
Actor,
3+
Body,
4+
Collider,
5+
Color,
6+
DisplayMode,
7+
Engine,
8+
Shape,
9+
} from "excalibur";
10+
import { io } from "socket.io-client";
11+
12+
const socket = io();
13+
14+
socket.on('disconnect', function() {
15+
location.reload();
16+
});
17+
18+
const engine = new Engine({
19+
backgroundColor: Color.Black,
20+
displayMode: DisplayMode.FullScreen,
21+
});
22+
23+
const square = new Actor({
24+
x: engine.halfDrawWidth,
25+
y: engine.halfDrawHeight,
26+
color: Color.White,
27+
body: new Body({
28+
collider: new Collider({
29+
shape: Shape.Box(engine.halfDrawWidth / 10, engine.halfDrawHeight / 10),
30+
}),
31+
}),
32+
});
33+
34+
engine.add(square);
35+
36+
engine.start();

0 commit comments

Comments
 (0)