Skip to content

Latest commit

 

History

History
75 lines (42 loc) · 5.11 KB

File metadata and controls

75 lines (42 loc) · 5.11 KB

Tic Tac Toe

SIK Networking Connected Lenses Sync Kit Multiplayer

tic-tac-toe

Overview

This is a sample Connected Lens project that uses Spectacles Sync Kit.

NOTE: This project will only work for the Spectacles platform.

Design Guidelines

Designing Lenses for Spectacles offers all-new possibilities to rethink user interaction with digital spaces and the physical world. Get started using our Design Guidelines

Prerequisites

  • Lens Studio: v5.15.1+
  • Spectacles OS Version: v5.64+
  • Spectacles App iOS: v0.64+
  • Spectacles App Android: v0.64+

To update your Spectacles device and mobile app, refer to this guide.

You can download the latest version of Lens Studio from here.

Getting the project

To obtain the project folder, you need to clone the repository.

IMPORTANT: This project uses Git Large Files Support (LFS). Downloading a zip file using the green button on Github will not work. You must clone the project with a version of git that has LFS. You can download Git LFS here: https://git-lfs.github.com/.

Initial Project Setup

The project should be pre-configured to get you started without any additional steps. However, if you encounter issues in the Logger Panel, please ensure your Lens Studio environment is set up for Spectacles.

Key Scripts

The following scripts sync the game using Spectacles Sync Kit features, including sync entities, storage properties, networked events, and the Instantiator to instantiate prefabs.

ContollerTS.ts / ControllerJS.js: This script controls assigning player roles and spawning X and O objects using the Instantiator component.

PieceTS.ts / PieceJS.js: This script is attached to each prefab. It enables manipulation for the player whose turn it is.

Testing the Lens

In Lens Studio Editor

Open two Preview panels to test with multiple users in the Connected Lens. Each Preview simluates a user in the multiplayer session. X and O objects will spawn for each user when it is their turn. Use your mouse to move and arrange the objects to play a game of Tic Tac Toe.

On Spectacles Device

To test Connected Lenses on your device, refer to the guide provided here.

After successfully installing the Lens, pinch the Multiplayer button to being the Connected Lenses colocated joining flow. Once two users have joined, the game begins by spawning an X for the first player.

Support

If you have any questions or need assistance, please don't hesitate to reach out. Our community is here to help, and you can connect with us and ask for support here. We look forward to hearing from you and are excited to assist you on your journey!

Contributing

Feel free to provide improvements or suggestions or directly contributing via merge request. By sharing insights, you help everyone else build better Lenses.


Built with 👻 by the Spectacles team