Pacman VR experience using web framework A-Frame
https://shaqian.github.io/pacman/
npm install
To make player move in the direction of the camera, we need to do a little hack with aframe-extras.
Go to node_modules/aframe-extras/src/pathfinding/nav-agent.js
. Make two changes:
Near line 5-6
schema: {
destination: {type: 'vec3'},
active: {default: false},
speed: {default: 2},
lookAtTarget: {default: true} // add this line
},
Near line 83-84
if (data.lookAtTarget) // add this line
el.object3D.lookAt(gazeTarget);
npm start
npm run build
Device rotation works on iOS devices but may not work on some Android devices because of issues with Chrome.
In non-VR mode you can still swipe screen to move the player.