-
Notifications
You must be signed in to change notification settings - Fork 10
Create my first game
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.
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!
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.
- The JSON files should have a UTF8 format
- You can use a JSON Editor for easy-create files
You can continue learn here.
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!