add use strict
This commit is contained in:
parent
ef260213b1
commit
53e97cd58b
14 changed files with 30 additions and 18 deletions
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
export default class Camera {
|
||||
constructor() {
|
||||
this.x = 0
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
import WsClient from './WsClient.js'
|
||||
import Protocol from './../common/Protocol.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
import { logger } from '../common/Util.js'
|
||||
|
||||
const log = logger('Debug.js')
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
import { Rng } from '../common/Rng.js'
|
||||
import Util from '../common/Util.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
function createCanvas(width = 0, height = 0) {
|
||||
const c = document.createElement('canvas')
|
||||
c.width = width
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
import Geometry from '../common/Geometry.js'
|
||||
import Graphics from './Graphics.js'
|
||||
import Util, { logger } from './../common/Util.js'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
import WsWrapper from './WsWrapper.js'
|
||||
|
||||
export default class WsClient extends WsWrapper {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
import Time from '../common/Time.js'
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
import Time from './../../common/Time.js'
|
||||
|
||||
const GameTeaser = {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
const ImageTeaser = {
|
||||
name: 'image-teaser',
|
||||
props: {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
const Upload = {
|
||||
name: 'upload',
|
||||
props: {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
"use strict"
|
||||
|
||||
export const run = options => {
|
||||
const fps = options.fps || 60
|
||||
const slow = options.slow || 1
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue