Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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
|
||||||
|
|||||||
+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