Skip to content

Create my first game

Manz edited this page Jan 28, 2014 · 10 revisions

Welcome adventurer! In this document I help you for create your first game.

First, on games folder you have a little example, called default. See it. You can rename it to other name and create your own game. By default, engine load game located inside default folder.

Step 1: Create folder structure

On folder games, create your folder-game (on this example, default).

Inside, you have four folders:

  • assets Folder with images, music or sounds.
  • chats Folder where saved chats.
  • data Folder where game is located (rooms). IMPORTANT
  • users Folder where saved game's player data (inventory, score, etc...)

Okay, let's go!

Step 2: Create my first room

Inside data folder, create a new room file (on this example, streetold.json). Room files have a JSON format. If you're not familiar with JSON files, you can use a JSON online validator for check syntax and errors.

Every room is a separated JSON file. At now, our file streetold.json is empty. Create a empty block:

{
}

And now, create a new block info with initial message about this room. Now, file contains this text:

{
  "info": {
     "image": "streetold.jpg",
     "description": "You are on a empty street."
  }
}

This description message appears when you start game. Also, engine find streetold.jpg image on assets folder and show it on current room on browser.

Important!

  • The JSON files should have a UTF8 format
  • You can use a JSON Editor for easy-create files

You can continue learn here.

Step 3: Prepare new player

Before play game, inside users folder, create a base.json file with initial new player data, for example:

{
  "info": {
      "room": "init_room"
  }
}

Where init_room is initial room where player start. Don't forget it! Also you can set initial items on inventory, for example.

Happy gaming!