Tic Tac Toe
Tic Tac Toeâ
A game of Tic Tac Toe

How to useâ
- Create tic tac toe vox model with this url
- Add cross vox model with this url and set the id
cross - Add nought vox model with this url and set the id
nought - Add this script to the tic tac toe board
- Reload the parcel
Scriptâ
let o = parcel.getFeatureById('nought')
let x = parcel.getFeatureById('cross')
let clones = []
let nought = true
feature.on('click', e => {
if (clones.length === 9) {
clones.forEach(c => c.remove())
clones = []
}
let c = (nought ? o : x).clone()
c.position.copyFrom(e.point)
clones.push(c)
nought = !nought
})
Improvementsâ
- Detect the winner and draw a line
- Require two players (once multiplayer is implemented)