Deployment fix
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 9.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 23 KiB |
@@ -3,7 +3,7 @@
|
||||
<Game v-if="isLoggedIn"/>
|
||||
<div v-else class="container mainMenu">
|
||||
<img src="./assets/logo.png" alt="TronIo logo" width="150px"/>
|
||||
<h1 class="title">Tron.io</h1>
|
||||
<h1 class="title">tron.io</h1>
|
||||
<b-button @click="loginPrompt">Start</b-button>
|
||||
</div>
|
||||
<b-loading v-model="isLoading"/>
|
||||
@@ -34,7 +34,6 @@ export default {
|
||||
this.$buefy.dialog.prompt({
|
||||
message: 'Choose a name',
|
||||
trapFocus: true,
|
||||
canCancel: false,
|
||||
inputAttrs: {
|
||||
placeholder: 'pedro',
|
||||
minlength: 3,
|
||||
|
||||
@@ -68,11 +68,10 @@ export default {
|
||||
this.canvas.height = window.innerHeight
|
||||
this.canvas.addEventListener('mousemove', this.mouseEvent)
|
||||
this.canvas.addEventListener('touchmove', this.touchEvent)
|
||||
this.renderTimer = setInterval(this.render, 1000 / 60)
|
||||
this.renderTimer = setInterval(this.render, 1000 / 120)
|
||||
},
|
||||
methods: {
|
||||
render () {
|
||||
this.stats.lastFrame = performance.now()
|
||||
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height)
|
||||
this.renderBorders()
|
||||
|
||||
@@ -99,6 +98,8 @@ export default {
|
||||
this.renderMouse()
|
||||
|
||||
this.renderDebug()
|
||||
|
||||
this.stats.lastFrame = performance.now()
|
||||
},
|
||||
renderBorders () {
|
||||
this.context.strokeStyle = 'white'
|
||||
@@ -138,11 +139,11 @@ export default {
|
||||
this.context.fillStyle = 'white'
|
||||
this.context.textAlign = 'start'
|
||||
this.context.fillText('camera x: ' + this.camera.x + ' y:' + this.camera.y, 10, 12)
|
||||
// this.context.fillText('a:' + player.angle + ' a_t' + player.targetAngle, 10, 24)
|
||||
this.context.fillText('canvasX: ' + canvasX + ' canvasY:' + canvasY, 10, 36)
|
||||
this.context.fillText('mouse x: ' + this.mouse.x + ' y:' + this.mouse.y, 10, 24)
|
||||
this.context.fillText('canvasX: ' + canvasX + ' canvasY: ' + canvasY, 10, 36)
|
||||
this.context.fillText('Total walls: ' + this.stats.totalWalls, 10, 48)
|
||||
this.context.fillText('Last update: ' + this.stats.lastUpdateTime, 10, 60)
|
||||
const fps = (performance.now() - this.stats.lastFrame) * 60
|
||||
const fps = 1000 / (performance.now() - this.stats.lastFrame)
|
||||
this.context.fillText('FPS: ' + fps, 10, 72)
|
||||
},
|
||||
renderMouse () {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import { register } from 'register-service-worker'
|
||||
import { ToastProgrammatic as Toast } from 'buefy'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
register(`${process.env.BASE_URL}service-worker.js`, {
|
||||
@@ -18,12 +19,16 @@ if (process.env.NODE_ENV === 'production') {
|
||||
},
|
||||
updatefound () {
|
||||
console.log('New content is downloading.')
|
||||
Toast.open('Update found, downloading...')
|
||||
},
|
||||
updated () {
|
||||
console.log('New content is available; please refresh.')
|
||||
window.location.reload(true)
|
||||
Toast.open('App updated !')
|
||||
},
|
||||
offline () {
|
||||
console.log('No internet connection found. App is running in offline mode.')
|
||||
Toast.open('No internet connection !')
|
||||
},
|
||||
error (error) {
|
||||
console.error('Error during service worker registration:', error)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ToastProgrammatic as Toast } from 'buefy'
|
||||
|
||||
const connection = new WebSocket('ws://localhost:8181/socket')
|
||||
// const connection = new WebSocket('wss://tronio.gltronic.ovh/socket')
|
||||
// const connection = new WebSocket('ws://localhost:8181/socket')
|
||||
const connection = new WebSocket('wss://tronio.gltronic.ovh/socket')
|
||||
|
||||
export default function createSocketPlugin () {
|
||||
return store => {
|
||||
|
||||
Reference in New Issue
Block a user