add use strict

This commit is contained in:
Zutatensuppe 2021-05-09 13:49:40 +02:00
parent ef260213b1
commit 53e97cd58b
14 changed files with 30 additions and 18 deletions

View file

@ -1,3 +1,5 @@
"use strict"
export default class Camera { export default class Camera {
constructor() { constructor() {
this.x = 0 this.x = 0

View file

@ -1,3 +1,5 @@
"use strict"
import WsClient from './WsClient.js' import WsClient from './WsClient.js'
import Protocol from './../common/Protocol.js' import Protocol from './../common/Protocol.js'

View file

@ -1,3 +1,5 @@
"use strict"
import { logger } from '../common/Util.js' import { logger } from '../common/Util.js'
const log = logger('Debug.js') const log = logger('Debug.js')

View file

@ -1,3 +1,5 @@
"use strict"
import { Rng } from '../common/Rng.js' import { Rng } from '../common/Rng.js'
import Util from '../common/Util.js' import Util from '../common/Util.js'

View file

@ -1,3 +1,5 @@
"use strict"
function createCanvas(width = 0, height = 0) { function createCanvas(width = 0, height = 0) {
const c = document.createElement('canvas') const c = document.createElement('canvas')
c.width = width c.width = width

View file

@ -1,3 +1,5 @@
"use strict"
import Geometry from '../common/Geometry.js' import Geometry from '../common/Geometry.js'
import Graphics from './Graphics.js' import Graphics from './Graphics.js'
import Util, { logger } from './../common/Util.js' import Util, { logger } from './../common/Util.js'

View file

@ -1,3 +1,5 @@
"use strict"
import WsWrapper from './WsWrapper.js' import WsWrapper from './WsWrapper.js'
export default class WsClient extends WsWrapper { export default class WsClient extends WsWrapper {

View file

@ -1,3 +1,5 @@
"use strict"
import Time from '../common/Time.js' import Time from '../common/Time.js'
/** /**

View file

@ -1,3 +1,5 @@
"use strict"
import Time from './../../common/Time.js' import Time from './../../common/Time.js'
const GameTeaser = { const GameTeaser = {

View file

@ -1,3 +1,5 @@
"use strict"
const ImageTeaser = { const ImageTeaser = {
name: 'image-teaser', name: 'image-teaser',
props: { props: {

View file

@ -1,3 +1,5 @@
"use strict"
const Upload = { const Upload = {
name: 'upload', name: 'upload',
props: { props: {

View file

@ -1,4 +1,5 @@
"use strict" "use strict"
import {run} from './gameloop.js' import {run} from './gameloop.js'
import Camera from './Camera.js' import Camera from './Camera.js'
import Graphics from './Graphics.js' import Graphics from './Graphics.js'
@ -308,7 +309,6 @@ function addMenuToDom(previewImageUrl) {
} }
function initme() { function initme() {
// return uniqId()
let ID = localStorage.getItem('ID') let ID = localStorage.getItem('ID')
if (!ID) { if (!ID) {
ID = Util.uniqId() ID = Util.uniqId()
@ -399,26 +399,12 @@ function EventAdapter (canvas, window, viewport) {
const createKeyEvents = () => { const createKeyEvents = () => {
let amount = SHIFT ? 20 : 10 let amount = SHIFT ? 20 : 10
let x = 0 let x = (LEFT ? amount : 0) - (RIGHT ? amount : 0)
let y = 0 let y = (UP ? amount : 0) - (DOWN ? amount : 0)
if (UP) {
y += amount
}
if (DOWN) {
y -= amount
}
if (LEFT) {
x += amount
}
if (RIGHT) {
x -= amount
}
if (x !== 0 || y !== 0) { if (x !== 0 || y !== 0) {
addEvent([Protocol.INPUT_EV_MOVE, x, y]) addEvent([Protocol.INPUT_EV_MOVE, x, y])
} }
// zoom keys
if (ZOOM_IN && ZOOM_OUT) { if (ZOOM_IN && ZOOM_OUT) {
// cancel each other out // cancel each other out
} else if (ZOOM_IN) { } else if (ZOOM_IN) {

View file

@ -1,3 +1,5 @@
"use strict"
export const run = options => { export const run = options => {
const fps = options.fps || 60 const fps = options.fps || 60
const slow = options.slow || 1 const slow = options.slow || 1
@ -28,4 +30,4 @@ export const run = options => {
export default { export default {
run run
} }

View file

@ -1,3 +1,5 @@
"use strict"
import GameCommon from './../../common/GameCommon.js' import GameCommon from './../../common/GameCommon.js'
import Time from './../../common/Time.js' import Time from './../../common/Time.js'
import Upload from './../components/Upload.vue.js' import Upload from './../components/Upload.vue.js'