diff --git a/backend/package.json b/backend/package.json index a70bc11..eb8a847 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "declared-server", - "version": "0.0.5", + "version": "0.0.6", "description": "Game server for decla.red", "keywords": [], "author": "András Schmelczer (https://schmelczer.dev/)", diff --git a/backend/src/objects/player-character-physical.ts b/backend/src/objects/player-character-physical.ts index 0813004..d14971c 100644 --- a/backend/src/objects/player-character-physical.ts +++ b/backend/src/objects/player-character-physical.ts @@ -135,7 +135,7 @@ export class PlayerCharacterPhysical this.movementActions.push(c); } - private addKill() { + public addKill() { this.killCount++; this.remoteCall('setKillCount', this.killCount); } diff --git a/frontend/package.json b/frontend/package.json index 47265f9..708b320 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "decla.red-frontend", "version": "0.0.0", - "description": "![logo](media/declared.png)", + "description": "", "keywords": [], "author": "András Schmelczer (https://schmelczer.dev/)", "sideEffects": [ diff --git a/frontend/src/index.html b/frontend/src/index.html index 81e35e0..16829d2 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -20,11 +20,12 @@ - - + + + decla.red diff --git a/frontend/src/index.ts b/frontend/src/index.ts index 7bdad78..ea1fe20 100644 --- a/frontend/src/index.ts +++ b/frontend/src/index.ts @@ -13,6 +13,10 @@ import { ProjectileView } from './scripts/objects/projectile-view'; import { PlanetView } from './scripts/objects/planet-view'; import './main.scss'; import '../static/og-image.png'; +import '../static/favicons/apple-touch-icon.png'; +import '../static/favicons/favicon-16x16.png'; +import '../static/favicons/favicon-32x32.png'; +import '../static/favicons/favicon.ico'; import { LandingPageBackground } from './scripts/landing-page-background'; import { JoinFormHandler } from './scripts/join-form-handler'; import { handleFullScreen } from './scripts/handle-full-screen'; diff --git a/frontend/src/scripts/objects/character-view.ts b/frontend/src/scripts/objects/character-view.ts index 349fdb5..8270fa2 100644 --- a/frontend/src/scripts/objects/character-view.ts +++ b/frontend/src/scripts/objects/character-view.ts @@ -1,13 +1,6 @@ import { vec2 } from 'gl-matrix'; import { Renderer } from 'sdf-2d'; -import { - CharacterBase, - CharacterTeam, - Circle, - Id, - settings, - UpdateMessage, -} from 'shared'; +import { CharacterBase, CharacterTeam, Circle, Id, settings } from 'shared'; import { BlobShape } from '../shapes/blob-shape'; import { ViewObject } from './view-object'; diff --git a/frontend/src/scripts/objects/lamp-view.ts b/frontend/src/scripts/objects/lamp-view.ts index f41333f..90b2b03 100644 --- a/frontend/src/scripts/objects/lamp-view.ts +++ b/frontend/src/scripts/objects/lamp-view.ts @@ -1,6 +1,6 @@ import { vec2, vec3 } from 'gl-matrix'; import { CircleLight, Renderer } from 'sdf-2d'; -import { CommandExecutors, Id, LampBase, UpdateMessage } from 'shared'; +import { CommandExecutors, Id, LampBase } from 'shared'; import { RenderCommand } from '../commands/types/render'; import { ViewObject } from './view-object'; diff --git a/frontend/src/scripts/objects/projectile-view.ts b/frontend/src/scripts/objects/projectile-view.ts index 6c3168b..296a5c4 100644 --- a/frontend/src/scripts/objects/projectile-view.ts +++ b/frontend/src/scripts/objects/projectile-view.ts @@ -1,6 +1,6 @@ import { vec2 } from 'gl-matrix'; import { CircleLight, ColorfulCircle, Renderer } from 'sdf-2d'; -import { CharacterTeam, Id, ProjectileBase, settings, UpdateMessage } from 'shared'; +import { CharacterTeam, Id, ProjectileBase, settings } from 'shared'; import { ViewObject } from './view-object'; export class ProjectileView extends ProjectileBase implements ViewObject { diff --git a/frontend/src/scripts/objects/view-object.ts b/frontend/src/scripts/objects/view-object.ts index 18c8a37..d93f4fc 100644 --- a/frontend/src/scripts/objects/view-object.ts +++ b/frontend/src/scripts/objects/view-object.ts @@ -1,5 +1,5 @@ import { Renderer } from 'sdf-2d'; -import { GameObject, UpdateMessage } from 'shared'; +import { GameObject } from 'shared'; export interface ViewObject extends GameObject { step(deltaTimeInMilliseconds: number): void; diff --git a/frontend/static/favicons/apple-touch-icon.png b/frontend/static/favicons/apple-touch-icon.png new file mode 100644 index 0000000..cabfeb2 Binary files /dev/null and b/frontend/static/favicons/apple-touch-icon.png differ diff --git a/frontend/static/favicons/favicon-16x16.png b/frontend/static/favicons/favicon-16x16.png new file mode 100644 index 0000000..5fe28d0 Binary files /dev/null and b/frontend/static/favicons/favicon-16x16.png differ diff --git a/frontend/static/favicons/favicon-32x32.png b/frontend/static/favicons/favicon-32x32.png new file mode 100644 index 0000000..d007086 Binary files /dev/null and b/frontend/static/favicons/favicon-32x32.png differ diff --git a/frontend/static/favicons/favicon.ico b/frontend/static/favicons/favicon.ico new file mode 100644 index 0000000..a733520 Binary files /dev/null and b/frontend/static/favicons/favicon.ico differ diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index d189f31..255841e 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -7,8 +7,6 @@ const TerserJSPlugin = require('terser-webpack-plugin'); const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin'); const Sass = require('sass'); -//const FaviconsWebpackPlugin = require('favicons-webpack-plugin'); - module.exports = { devServer: { host: '0.0.0.0', @@ -34,9 +32,6 @@ module.exports = { ], }), - //new FaviconsWebpackPlugin('static/logo.svg'), - // Multi threading typescript loader configuration with caching for .ts and .tsx files - // see https://github.com/namics/webpack-config-plugins/tree/master/packages/ts-config-webpack-plugin/config new TsConfigWebpackPlugin(), ], optimization: { @@ -80,7 +75,7 @@ module.exports = { }, }, { - test: /\.mp3$/, + test: /\.(mp3|png)$/, use: { loader: 'file-loader', query: { @@ -89,6 +84,16 @@ module.exports = { }, }, }, + { + test: /\.ico$/, + use: { + loader: 'file-loader', + query: { + outputPath: '/', + name: '[name].[ext]', + }, + }, + }, { test: /og-image.png$/, use: { diff --git a/shared/src/main.ts b/shared/src/main.ts index 9031c73..f00b11c 100644 --- a/shared/src/main.ts +++ b/shared/src/main.ts @@ -46,7 +46,6 @@ export * from './transport/serialization/serializable'; export * from './transport/serialization/override-deserialization'; export * from './objects/types/character-base'; export * from './objects/types/character-team'; -export * from './objects/update-message'; export * from './objects/types/player-character-base'; export * from './objects/types/lamp-base'; export * from './objects/types/planet-base'; diff --git a/shared/src/objects/interpolation-type.ts b/shared/src/objects/interpolation-type.ts deleted file mode 100644 index 49a8aed..0000000 --- a/shared/src/objects/interpolation-type.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum InterpolationType { - flat = 'flat', - linear = 'linear', - linearRotation = 'linearRotation', -} diff --git a/shared/src/objects/types/character-base.ts b/shared/src/objects/types/character-base.ts index d785d22..b9d0607 100644 --- a/shared/src/objects/types/character-base.ts +++ b/shared/src/objects/types/character-base.ts @@ -17,6 +17,8 @@ export class CharacterBase extends GameObject { super(id); } + public onShoot(strength: number) {} + public toArray(): Array { const { id, team, health, head, leftFoot, rightFoot } = this; return [id, team, health, head, leftFoot, rightFoot]; diff --git a/shared/src/objects/update-message.ts b/shared/src/objects/update-message.ts deleted file mode 100644 index 7ebb56c..0000000 --- a/shared/src/objects/update-message.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { serializable } from '../transport/serialization/serializable'; -import { InterpolationType } from './interpolation-type'; - -@serializable -export class UpdateMessage { - constructor( - public key: string, - public value: any, - public interpolationType?: InterpolationType, - ) {} - - public toArray(): Array { - return [this.key, this.value, this.interpolationType]; - } -}