Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f2b4222b7 | |||
|
|
23611b76d9 | ||
|
|
90c868d9e9 | ||
|
|
452c35c1b0 | ||
|
|
9dea6014fe | ||
|
|
e37d737d3a | ||
|
|
65c7b930e3 | ||
|
|
082176d75e | ||
|
|
18673c95c4 | ||
|
|
cb52bd1561 |
+3
-1
@@ -1,6 +1,6 @@
|
|||||||
FROM nginx:latest
|
FROM nginx:latest
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y nodejs npm
|
RUN apt-get update && apt-get install -y nodejs npm netcat-openbsd
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -20,4 +20,6 @@ COPY src/*.css ./public
|
|||||||
|
|
||||||
RUN cp /app/build/* ./public
|
RUN cp /app/build/* ./public
|
||||||
|
|
||||||
|
HEALTHCHECK CMD nc -z 127.0.0.1 80
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
+5
-5
@@ -6,11 +6,6 @@
|
|||||||
<link rel="stylesheet" href="public/home.css" />
|
<link rel="stylesheet" href="public/home.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="navigation">
|
|
||||||
<a class="navItem" href="https://www.github.com/trimutex">GitHub</a>
|
|
||||||
<a class="navItem" href="https://lab.trianta.dev/Trianta">Projects</a>
|
|
||||||
<p class="navItem" style="text-align: right; flex-grow: 1;">Trianta</p>
|
|
||||||
</div>
|
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2 class="cardTop">Pong</h2>
|
<h2 class="cardTop">Pong</h2>
|
||||||
@@ -35,5 +30,10 @@
|
|||||||
<a class="navItem" href="https://lab.trianta.dev/Trianta/trianta.dev/src/branch/main/src/snake.ts">View Code</a>
|
<a class="navItem" href="https://lab.trianta.dev/Trianta/trianta.dev/src/branch/main/src/snake.ts">View Code</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="navigation">
|
||||||
|
<a class="navItem" href="https://www.github.com/trimutex">GitHub</a>
|
||||||
|
<a class="navItem" href="https://lab.trianta.dev/Trianta">Projects</a>
|
||||||
|
<p class="navItem" style="text-align: right; flex-grow: 1;">Trianta</p>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "trianta.dev",
|
"name": "trianta.dev",
|
||||||
"version": "0.1.0",
|
"version": "0.2.1",
|
||||||
"description": "My personal website",
|
"description": "My personal website",
|
||||||
"main": "index.html",
|
"main": "index.html",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+1
-10
@@ -60,11 +60,10 @@ class SnakeCore {
|
|||||||
foodAte: boolean;
|
foodAte: boolean;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
// TODO: Add CSS stuff for page
|
|
||||||
this.canvas = document.getElementById('snake') as HTMLCanvasElement;
|
this.canvas = document.getElementById('snake') as HTMLCanvasElement;
|
||||||
this.context = this.canvas.getContext('2d') as CanvasRenderingContext2D;
|
this.context = this.canvas.getContext('2d') as CanvasRenderingContext2D;
|
||||||
this.grid = 25; // size of grid squares
|
this.grid = 25; // size of grid squares
|
||||||
this.timeout = 20; // speed in ms
|
this.timeout = 32; // speed in ms
|
||||||
this.width = 25;
|
this.width = 25;
|
||||||
this.height = 15;
|
this.height = 15;
|
||||||
this.board = [];
|
this.board = [];
|
||||||
@@ -213,7 +212,6 @@ class Bot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Fix trim function
|
|
||||||
trim() {
|
trim() {
|
||||||
let reachedSnake = false;
|
let reachedSnake = false;
|
||||||
this.path.push(this.pathUntrimmed.pop() as Point); // Push food location
|
this.path.push(this.pathUntrimmed.pop() as Point); // Push food location
|
||||||
@@ -240,13 +238,6 @@ class Bot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
values:
|
|
||||||
0 = left
|
|
||||||
1 = up
|
|
||||||
2 = right
|
|
||||||
4 = down
|
|
||||||
*/
|
|
||||||
nextMove() {
|
nextMove() {
|
||||||
// Get new path to food
|
// Get new path to food
|
||||||
if (this.path.length === 0)
|
if (this.path.length === 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user