Ein Großteil der Zeit waren wir damit beschäftigt, das Meteor Framework kennen zu lernen und uns mit den Best Practices vertraut zu machen.
Julian Palmanshofer
Juri Schreib
To create a new Game navigate to the Game configuration Site by clicking on Quick Play on the Homepage.
In the current Version of Battleship, no game configuration options exist. So continue by pressing the Submit button
You will be redirected to another Page that looks like this:
Notice that on the Top, it says that it is waiting for another Player. Look in Joining a Game to learn how to invite another Player.
To join an existing Game, the creator has to send you the Link of the current Game by copying the URL from the Address bar.
After you recieved the URL enter it into a webbrowser and open the Page. You will be greeted by a Page that looks like this:
To join the Game, click on the Blue Join Game Button on the top Left corner.
After you clicked it, the Blue Box should disappear for both players.
Both player should see a text appear inside the grey Bar, which tells them who goes first:
In the first phase of the Game you can place your Ships on the Gameboard.
You will see the name and the length of the Ship you place inside the Grey Bar on the Top.
You can toggle the Rotation of the Ship by clicking on the Horial button
To place the Ship click on a box inside your Board. Clicking on a Box will put the top left part of the Ship on the Board.
After placeing the first Ship, the Ship description inside the Grey Bar will change and X will appear where you set the Ship.
Continue to place all Ships in this fashion
After you placed all ships, the Ship description will change into a Start Button.
When you press Start, a blue Box will apperar.
It means that only one Player finished placing all ships and pressed the start button.
The Game will proceed after both Players clicked the Start Button.
After the Game Stars a Second board will appar. On the Top you will see a Box that indicates which turn it currently is.
When its your turn use the Bottom board to guess the locations of the opponetn Ships. If you miss a ship, the box will be colourd blue, if you hit a ship, it will be colored red.
THe guesses of your opponent will be highlited in the top gameboard by grey boxes
Missed Ship
Hit Ship
Highlighted Guesses of your opponent.
After you sunken all ships of your opponents a message will apperar
You can continue playing after that
Battleship Technical Documentation
The Project is written using Meteor. Follow the instructions on the Website to install Meteor on your system. After that you should be able to execute meteor
in the root directory of this project to install all dependencies and get a test instance running.
|
|- client
| |- stylesheets /* Stylesheets go here */
| |- main.js /* Import /imports/startup/client */
|
|- server
| |- main.js /* Import /imports/startup/server */
|
|-imports
|- api /* API: Server publications and Methods */
| |- [model] /* Name of the Model provided by the API */
| | |- [model].js /* API definition */
|
|- startup
| |- client
| | |- index.js /* Import Modules that should be run on the Client */
| | |- routes.js /* URL Routes declaration */
| |
| |- server
| |- index.js /* Import Modules that should be run on the Server */
|
|- ui
|- layouts /* Layout Templates */
| |- [layout].html /* html Blaze Template */
| |- [layout].js /* javascript Blaze Template */
|
|- pages /* Page Templates */
| |- [page].html /* html Blaze Template */
| |- [page].js /* javascript Blaze Template */
When a Player generates a new Game a Game Object will be created inside the Database. As more and more information is collected about the Game, the Model, the furhter it will be extended. Since Meteor runs on MongoDb we don’t have to define a fixed schema and are free to do so.
The follwing Packages are available for the client:
Feel free to use them to make your development ecperience easier and to keep the design consistend.
Most of the Applicaiton logic is located in the follwing Files:
/imports/ui/pages/game.html
/imports/ui/pages/game.js
/imports/api/game/index,js
If you want to modify the programming logic, the best bet is to start orienting and looking in the files listed above.
Refer to the Source Code Documentation to gain more insight of the inner workings of the Project
##Source Code Documentation
Location /imports/api/games/games.js
Retrieve a Game Object from the Database using its ID
Adds a new Game Object to the Database
Adds a new Game Object to the Database
Adds an Opponent to the an existing Game Object
Adds a Users Board with placed ships to a Game Object
Adds a Users Turn (trying to hit an opponents ship) to a Game Object
Cheks if a Turn hits or missed a Ship
Location /imports/ui/pages/game.js
Retrieves a Game Object form the Database
Returns
Param
Param
Param
Param
Param
Returns
Param
Param
Param
All Events have one event parameter
A new player joins the current Game
Toggles between Horizontal and Vertical Ship orientation
Places a new Ship on the Players board
Starts the Game, by submitting each Players gameBoard to the Server
executes a new TUrn of the current Player and submits it to the Database