JSON serial change & working basic gameplay

This commit is contained in:
Thomas
2020-08-27 11:10:00 +02:00
parent e2e4495f02
commit cec5fca5c4
16 changed files with 131 additions and 52 deletions

View File

@@ -4,8 +4,6 @@ const state = {
y: 100,
angle: 0,
targetAngle: 0,
walls: [],
lastWall: 0,
color: 'red'
},
players: {
@@ -37,8 +35,10 @@ const actions = {
commit('SET_SETTINGS', settings)
},
update ({ commit }, update) {
commit('SET_PLAYERS', update)
},
dead ({ commit }) {
dead ({ commit }, player) {
commit('SET_PLAYER', player)
},
error ({ commit }, error) {
alert('Error: ' + error)
@@ -49,6 +49,9 @@ const mutations = {
SET_PLAYER (state, player) {
state.player = player
},
SET_PLAYERS (state, players) {
state.players = players
},
SET_SETTINGS (state, settings) {
state.settings = settings
},