9. Workshop-BattleGame-Description

advertisement
33, Alexander Malinov Blvd., Sofia, 1729, Bulgaria
Phone: (+359) 2 80-99-862; Fax: (+359) 2 80-99-888
Battle Game – Web Client
You are given server logic in the form of web services, which implement the Battle game. Your task is to
develop a client-side application using HTML, CSS and JavaScript (+jQuery), that uses (consumes) these
services, to allow users to play the game against other users, using their web browser. Users play in their
browser and sees the result of their and the other user's play. Users should be able to login and play the
game from different devices, but still get the same data on all of them.
Battle Game Description
The battle game is always played with two players (red player and blue player).
The game is always played on a battle field with size 9x9. When a game is started, both players begin
with four ranger units and five warrior units. Each unit has a Position, Attack, Armor, Hit points, Range
and Speed. Players make their moves in turns, and in each turn each player can move a unit, attack a
unit of the opponent, or put their unit in defend mode.
The ranger and warrior units have the following characteristics:
Unit Type
Attack
Armor
Hit points
Range
Speed
Warrior
8
3
15
1
2
Ranger
8
1
10
3
1
Distances in the game (range and speed) are calculated by the Manhattan (Taxicab) distance formula.
The game ends when one of the opponents has 0 (zero) alive units.
Attack
A unit (Attacker) can attack units within its range. An attacked unit (Target) is in range when:
Attacker.Range >= |Attacker.position.x – Target.position.x| + |Attacker.position.y – Target.position.y|
When a unit (Attacker) attacks a unit (Target) of the opponent, the damage done to the attacked unit's
hit points is calculated as follows:
Target.hitpoints = Target.hitpoints – (Attacker.attack – Target.armor)
If the Target is in "defend" mode, the damage done to the attacked unit's hit points is:
Target.hitpoints = Target.hitpoints – (Attacker.attack – 2 * Target.armor)
If unit's hit points are equal or less than 0 (zero), the unit dies and is no longer considered in the game.
Move
A unit (Unit) can move to another position (Dest) within the battle field, when the position is empty and
Unit.speed >= |Unit.position.x – Dest.x| + |Unit.position.y – Dest.y|
Defend
A unit can go in defend mode. Once in defend mode, it stays in that mode, until it moves or attacks.
Deliver more than expected
Page 1 of 3
www.telerik.com
33, Alexander Malinov Blvd., Sofia, 1729, Bulgaria
Phone: (+359) 2 80-99-862; Fax: (+359) 2 80-99-888
Battle Game Sections
The game is divided in the following sections:

Users section - register, login and logout

Games section - creating, joining and starting games

Battle section - Gameplay
Users section:

New users can register a new account in the system
o They should provide a username, nickname and password

Returning users can login in the system with an existing account
o They should provide a username and password

Users, logged in the system, can logout
Games section:

Players can create games
o Each game has a title and an optional password
o The creator of the game is immediately assigned as red player

All players can see the created games, that are not full

Players can join games - The joining player is immediately assigned as blue player

Red players can start a game they created, if a blue player has joined their game

Both players start playing the game
Battle section:

Begins when a game is started
o Both red and blue players must be present

The game is played in turns
o The beginning turn is randomly given to one of the players
o When the player in turn makes their move, the turn is given to the other player, etc…

The player in turn can perform either an attack, defend or move
Evaluation criteria

Abstract implementation of the Data Layer – total up to 20 points
o Battle services – up to 5 points
o User services – up to 5 points
o Message services – up to 5 points
o Game services – up to 5 points
Deliver more than expected
Page 2 of 3
www.telerik.com
33, Alexander Malinov Blvd., Sofia, 1729, Bulgaria
Phone: (+359) 2 80-99-862; Fax: (+359) 2 80-99-888

Implementation of the UI logic – total up to 50 points
o Login/Register/Logout functionality – up to 5 points
o Listing of open and active games – up to 5 points
o Creating/Joining/Starting games – up to 5 points
o Visualizing current game – up to 10 points
o Current game operations (attack, defend, move) – up to 10 points
o Message visualization – up to 5 points
o Usability – up to 5 points
o Escaping UI data – up to 5 points

Server response error handling – total up to 10 points
o Invalid login/register responses
o Invalid join/create/start game responses
o Invalid unit operation (move, attack, defend) responses
o General error responses (wrong session key, etc.)

Object-oriented design & quality code – total up to 20 points
o Separate data and UI layers – up to 10 points
o Meaningful usage of objects – up to 5 points
o Closures and Immediately Invoked Function Expressions for scoping – up to 5 points

Bonuses – total up to 10 points
o UI Stylization & Design – up to 5 points
o UI Animations – up to 5 points
Project Requirements
The WEB application should work on at least two of the following browsers:

Internet Explorer 9 or higher

Google Chrome 25 or higher

Mozilla Firefox 12 or higher
The project should be implemented using some of, but limited to, the following:

HTML, CSS and JavaScript

jQuery
o jQuery UI and/or KendoUI

Any promise library

Any OOP library
Deliver more than expected
Page 3 of 3
www.telerik.com
Download