Game On! is both a sample microservices application, and a throwback text adventure brought to you by the wasdev team at IBM. This application demonstrates how microservice architectures work from two points of view:
- As a Player: navigate through a network/maze of rooms, where each room is a unique implementation of a common API. Each room supports chat, and interaction with items (some of which may be in the room, some of which might be separately defined services as well).
- As a Developer: learn about microservice architectures and their supporting infrastructure by extending the game with your own services. Write additional rooms or items and see how they interact with the rest of the system.
You can learn more about Game On! at http://game-on.org/.
##Introduction
This walkthrough will guide you through adding a room to a running Game On! microservices application. You will be shown how to setup a Node.js room that is deployed as a Cloud Foundry application in Bluemix.
When deployed using an instant runtime, Gameon-room-nodejs requires:
To build a Game On! room in Bluemix, you will first need a Bluemix account.
Sign up for Bluemix at https://console.ng.bluemix.net and DevOps Services at https://hub.jazz.net. When you sign up, you'll create an IBM ID, create an alias, and register with Bluemix.
For a new room to register with the Game On! application, you must first log into game-on.org and sign in using one of several methods to get your Game On! ID and Shared Secret.
- Go to https://game-on.org/ and click Enter.
- Select an authentication method and log in with your user name and password for that type.
- View your user profile using the link in the top right. It is either your username or a person icon.
- You should now see your Game On! ID and Shared Secret near the bottom of the page.
Our source code is stored on GitHub.
- Go to the project's GitHub repository and fork it to your own GitHub repository.
- Navigate to IBM DevOps.
- Click CREATE PROJECT.
- Enter a name for your Project.
- Select Link to an existing GitHub repository.
- Select Link to a Git Repo on GitHub.
- Choose your newly forked project from the dropdown menu that appears.
- Choose your Region, Organization, and Space. Generally the defaults will be sufficient.
- Click CREATE. This will fork your GitHub project into IBM DevOps services, and redirect you to your new project.
Once you have created your new project, you will be able to configure the room to your liking.
- From your IBM DevOps project, click EDIT CODE at the upper right corner of your project's overview page.
- Click on the Play button found above the README, this will deploy your app to Bluemix.
- Click on DASHBOARD at the top right of the page to navigate to your Bluemix dashboard.
- Select the newly deployed application which will be named after your project.
- Click Environment Variables on the left side of your application's Overview page.
- Click ADD, for Name enter GAMEONUID, and use the Game On! ID you got earlier for Value.
- Click ADD, for Name enter GAMEONAPIKEY, and use the Shared Secret you got earlier for Value.
- Click ADD, for Name enter ROOM_NAME, for Value enter what you'd like your room to be named.
- Click ADD, for Name enter FULL_NAME, for Value enter what you'd like your room's description to be.
- Click SAVE.
Once the room is set up and it has registered with Game On!, it will be accessible on Game On!. It may take a moment for the room to appear.
- Log in to Game On! using the authentication method you used to create your user ID and shared secret for the registered room.
- Use the Game On! command
/listmyrooms
from The First Room, to see your list of rooms. Once your room is registered, it will appear in that list. - To get to your room, navigate through the network or go directly there by using the
/teleport
command from The First Room. - Look at the Bluemix log console to see "A new connection has been made to the room" command from The First Room.
The Game On! host provides a set a universal commands:
- /exits - List of all exits from the current room.
- /help - List all available commands for the current room.
- /sos - Go back to The First Room.
The First Room is usually where new users will start in Game On!. From there, additional commands are available and maintained by Game On!. For the list of current commands use the /help
command.