Tutorials/quickstart

From CubeiaWiki

Jump to: navigation, search

Introduction

This quickstart will get you up with a Firebase and a Flex client in a few minutes. Within this time you will:

  1. Create and compile a new server game.
  2. Run your new game on a Firebase server.
  3. Create and compile a new Flex client.
  4. Connect with your new client to the server.

This tutorial is hard core by design, it will not explain itself along the way, but there you go: You have been warned :-)

Prerequisites

  • Java (v. 6 or higher)
  • Maven (v. 3.0 or higher)

Tutorialize

  • Open a new terminal.
  • Create a new game server project:
mvn archetype:generate \
    -DarchetypeGroupId=com.cubeia.firebase.tools \
    -DarchetypeArtifactId=firebase-game-archetype \
    -DarchetypeVersion=1.8.0 \
    -DarchetypeRepository=http://m2.cubeia.com/nexus/content/groups/public \
    -DgroupId=net.test \
    -DartifactId=helloWorldGame \
    -Dversion=1.0-SNAPSHOT \
    -Dpackage=net.test \
    -DgameId=888
  • Change directory to "helloWorldGame":
cd helloWorldGame
  • Compile the server game, and start Firebase:
mvn package firebase:run
  • Open a new terminal.
  • Create a new Flex client project:
mvn archetype:generate \
    -DarchetypeGroupId=com.cubeia.firebase.tools \
    -DarchetypeArtifactId=firebase-flex-archetype \
    -DarchetypeVersion=1.8.0 \
    -DarchetypeRepository=http://m2.cubeia.com/nexus/content/groups/public \
    -DgroupId=net.test \
    -DartifactId=helloWorldClient \
    -Dversion=1.0-SNAPSHOT \
    -Dpackage=net.test \
    -DgameId=888
  • Change directory to "helloWorldClient":
cd helloWorldClient
  • Compile and package Flex client:
mvn package
  • Open a browser and drop "target/helloWorldClient-1.0-SNAPSHOT.swf" into it.
  • Click "login" on the first window:
Firebase Server Address: 127.0.0.1
Port: 4123
  • Log in with a username of choise and any integer as password:
Username: testing1
Password: 1234
  • That's it! You can now join tables, and chat with other players at those tables.
Personal tools