# Work In progress pages

on top of that we need to create 2 new files a gameroom.ts file and state.ts files

the state file will handle all the data

the gameroom file will handle all the callbacks

\
\
\
\
\
\
\
The state will be received by all players so you do not want to have all the info on the state\
\
All you want to keep in the state that is allowed to be shared globally

![](/files/z9flGUvdUyGg3Hv0azj3)

Example battleship game:

* Shots fired by all players should be in the state
* Position of the ships should not be in the state otherwise is accessible to all players

Schema is a build in Colyseus and allows to send data back and forward between Client and Server

Schema comes with some parameters {Schema, type, MapSchema, ArraySchema }

Schema -> Colyseus framework

type -> is the language which is typescrypt&#x20;

MapSchema -> Basically is an object

ArraySchema -> is to use array

We start by creating a RoomState first and we need to know which players are in the room

in the case for single players used in OP Games&#x20;

you need additional annotation for schema to work

class PlayerState extends Schema {

&#x20;sessionID: string;

![](/files/FX91THZf1Ec5wZCgx8mZ)

}

export class RoomState extends Schema {

@type({map: PlayerState})

&#x20;players: MapSchema\<PlayerState>

}\
\
Lets go to our GameRoom File

import { Client, Room } from "colyseus"

import {RoomState, PlayerState} from "./state"

export class GameRoom extends Room\<RoomState> {

}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.arcadia.fun/colyseus-integration/arcadia-tournaments/work-in-progress-pages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
