Linking UI with Connected Lenses

Hey everyone! This is my first time using lens studio. I want to make a rock-paper-scissor game with Connected Lenses that would show a part of the other player's screen (or just the related part of their interface) to see what sign they made. any idea if that is possible? (sorry if this is too vague)

Answers

  • Bakari Mustafa
    Bakari Mustafa Posts: 178 🔥🔥🔥
    edited January 2023 #2

    Hi Ghada,

    It is possible to create a rock-paper-scissor game with Connected Lenses that shows a part of the other player's screen. To do this, you will need to use the Connected Lenses API, which allows you to send and receive data between devices in real-time.

    Here is an example of how you could use the Connected Lenses API to create a rock-paper-scissor game:

    1. Set up the Connected Lenses API: Follow the instructions in the Connected Lenses documentation to set up the Connected Lenses API in your project.
    2. Create a rock-paper-scissor interface: Create an interface for the rock-paper-scissor game that allows players to choose their move (rock, paper, or scissors).
    3. Use the Connected Lenses API to send data between devices: Use the Connected Lenses API to send data from one device to the other when a player makes a move. For example, you could use the "sendData" function to send the player's move (rock, paper, or scissors) to the other device.
    4. Use the received data to update the interface: On the other device, use the received data to update the interface and show the other player's move.