diff --git a/public/Camera.js b/public/Camera.js index f6985b1..f44c438 100644 --- a/public/Camera.js +++ b/public/Camera.js @@ -1,3 +1,5 @@ +"use strict" + export default class Camera { constructor() { this.x = 0 diff --git a/public/Communication.js b/public/Communication.js index 7277168..9a5b107 100644 --- a/public/Communication.js +++ b/public/Communication.js @@ -1,3 +1,5 @@ +"use strict" + import WsClient from './WsClient.js' import Protocol from './../common/Protocol.js' diff --git a/public/Debug.js b/public/Debug.js index 35c6925..6d8b7c9 100644 --- a/public/Debug.js +++ b/public/Debug.js @@ -1,3 +1,5 @@ +"use strict" + import { logger } from '../common/Util.js' const log = logger('Debug.js') diff --git a/public/Fireworks.js b/public/Fireworks.js index 3cda120..3ce3170 100644 --- a/public/Fireworks.js +++ b/public/Fireworks.js @@ -1,3 +1,5 @@ +"use strict" + import { Rng } from '../common/Rng.js' import Util from '../common/Util.js' diff --git a/public/Graphics.js b/public/Graphics.js index 1de3863..16a692d 100644 --- a/public/Graphics.js +++ b/public/Graphics.js @@ -1,3 +1,5 @@ +"use strict" + function createCanvas(width = 0, height = 0) { const c = document.createElement('canvas') c.width = width diff --git a/public/PuzzleGraphics.js b/public/PuzzleGraphics.js index fd54444..93922ed 100644 --- a/public/PuzzleGraphics.js +++ b/public/PuzzleGraphics.js @@ -1,3 +1,5 @@ +"use strict" + import Geometry from '../common/Geometry.js' import Graphics from './Graphics.js' import Util, { logger } from './../common/Util.js' diff --git a/public/WsClient.js b/public/WsClient.js index aff7b59..c01a633 100644 --- a/public/WsClient.js +++ b/public/WsClient.js @@ -1,3 +1,5 @@ +"use strict" + import WsWrapper from './WsWrapper.js' export default class WsClient extends WsWrapper { diff --git a/public/WsWrapper.js b/public/WsWrapper.js index 10ead38..f85ddb4 100644 --- a/public/WsWrapper.js +++ b/public/WsWrapper.js @@ -1,3 +1,5 @@ +"use strict" + import Time from '../common/Time.js' /** diff --git a/public/components/GameTeaser.vue.js b/public/components/GameTeaser.vue.js index 13369b4..41b198f 100644 --- a/public/components/GameTeaser.vue.js +++ b/public/components/GameTeaser.vue.js @@ -1,3 +1,5 @@ +"use strict" + import Time from './../../common/Time.js' const GameTeaser = { diff --git a/public/components/ImageTeaser.vue.js b/public/components/ImageTeaser.vue.js index 90904ee..729c223 100644 --- a/public/components/ImageTeaser.vue.js +++ b/public/components/ImageTeaser.vue.js @@ -1,3 +1,5 @@ +"use strict" + const ImageTeaser = { name: 'image-teaser', props: { diff --git a/public/components/Upload.vue.js b/public/components/Upload.vue.js index 8088f2e..83acea0 100644 --- a/public/components/Upload.vue.js +++ b/public/components/Upload.vue.js @@ -1,3 +1,5 @@ +"use strict" + const Upload = { name: 'upload', props: { diff --git a/public/game.js b/public/game.js index 46ff2be..ee050f2 100644 --- a/public/game.js +++ b/public/game.js @@ -1,4 +1,5 @@ "use strict" + import {run} from './gameloop.js' import Camera from './Camera.js' import Graphics from './Graphics.js' @@ -308,7 +309,6 @@ function addMenuToDom(previewImageUrl) { } function initme() { - // return uniqId() let ID = localStorage.getItem('ID') if (!ID) { ID = Util.uniqId() @@ -399,26 +399,12 @@ function EventAdapter (canvas, window, viewport) { const createKeyEvents = () => { let amount = SHIFT ? 20 : 10 - let x = 0 - let y = 0 - if (UP) { - y += amount - } - if (DOWN) { - y -= amount - } - if (LEFT) { - x += amount - } - if (RIGHT) { - x -= amount - } - + let x = (LEFT ? amount : 0) - (RIGHT ? amount : 0) + let y = (UP ? amount : 0) - (DOWN ? amount : 0) if (x !== 0 || y !== 0) { addEvent([Protocol.INPUT_EV_MOVE, x, y]) } - // zoom keys if (ZOOM_IN && ZOOM_OUT) { // cancel each other out } else if (ZOOM_IN) { diff --git a/public/gameloop.js b/public/gameloop.js index 857b9fc..038597a 100644 --- a/public/gameloop.js +++ b/public/gameloop.js @@ -1,3 +1,5 @@ +"use strict" + export const run = options => { const fps = options.fps || 60 const slow = options.slow || 1 @@ -28,4 +30,4 @@ export const run = options => { export default { run -} \ No newline at end of file +} diff --git a/public/views/Index.vue.js b/public/views/Index.vue.js index 6d4796c..ba73afb 100644 --- a/public/views/Index.vue.js +++ b/public/views/Index.vue.js @@ -1,3 +1,5 @@ +"use strict" + import GameCommon from './../../common/GameCommon.js' import Time from './../../common/Time.js' import Upload from './../components/Upload.vue.js'