> For the complete documentation index, see [llms.txt](https://gitbook.arcadia.fun/colyseus-integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.arcadia.fun/colyseus-integration/arcadia-tournaments/work-in-progress-pages.md).

# 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> {

}
