Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a754319374 | |||
|
|
4aeed537d7 | ||
|
|
f725b4e922 | ||
|
|
8252f38bb7 | ||
|
|
e4d9afdd68 | ||
|
|
90c868d9e9 | ||
|
|
452c35c1b0 | ||
|
|
9dea6014fe | ||
|
|
e37d737d3a | ||
|
|
65c7b930e3 | ||
|
|
082176d75e | ||
|
|
18673c95c4 | ||
|
|
cb52bd1561 |
+4
-2
@@ -1,6 +1,6 @@
|
||||
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
|
||||
|
||||
@@ -14,10 +14,12 @@ RUN npm run build
|
||||
|
||||
WORKDIR /usr/share/nginx/html
|
||||
COPY index.html .
|
||||
COPY default.css .
|
||||
|
||||
RUN mkdir -p /usr/share/nginx/html/public
|
||||
COPY src/*.css ./public
|
||||
|
||||
RUN cp /app/build/* ./public
|
||||
|
||||
HEALTHCHECK CMD nc -z 127.0.0.1 80
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Trianta</title>
|
||||
<link rel="stylesheet" href="public/home.css" />
|
||||
<link rel="stylesheet" href="default.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="navigation">
|
||||
|
||||
Generated
+5
-5
@@ -1,21 +1,21 @@
|
||||
{
|
||||
"name": "trianta.dev",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "trianta.dev",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"typescript": "^5.5.4"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.5.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz",
|
||||
"integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
|
||||
"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "trianta.dev",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.2",
|
||||
"description": "My personal website",
|
||||
"main": "index.html",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background: black;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.button {
|
||||
background: blue;
|
||||
color: white;
|
||||
padding: 15px 20px;
|
||||
font-size: 32px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
+1
-10
@@ -60,11 +60,10 @@ class SnakeCore {
|
||||
foodAte: boolean;
|
||||
|
||||
constructor() {
|
||||
// TODO: Add CSS stuff for page
|
||||
this.canvas = document.getElementById('snake') as HTMLCanvasElement;
|
||||
this.context = this.canvas.getContext('2d') as CanvasRenderingContext2D;
|
||||
this.grid = 25; // size of grid squares
|
||||
this.timeout = 20; // speed in ms
|
||||
this.timeout = 32; // speed in ms
|
||||
this.width = 25;
|
||||
this.height = 15;
|
||||
this.board = [];
|
||||
@@ -213,7 +212,6 @@ class Bot {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Fix trim function
|
||||
trim() {
|
||||
let reachedSnake = false;
|
||||
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() {
|
||||
// Get new path to food
|
||||
if (this.path.length === 0)
|
||||
|
||||
Reference in New Issue
Block a user