Skip to content

Commit

Permalink
Implemented 'move', 'attack' and 'pass' actions. Implemented 'BattleS…
Browse files Browse the repository at this point in the history
…ervice.last_state()' periodic calls. Implemented fast user switching on 'Frontpage view'. 'Battle view' now playable ...
  • Loading branch information
juraj committed Jun 20, 2013
1 parent 31a156b commit 7443c8a
Show file tree
Hide file tree
Showing 16 changed files with 567 additions and 119 deletions.
106 changes: 80 additions & 26 deletions res/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,63 @@ div.menu {
/* Battle view markup (TEMP)
* ---------------------------------------------------------------------------------------------------------------------- */

div.toolbox {
float: right;
div.game_over {
position: fixed;
width: 100%;
height: 40%;
margin: 30% 0px 30% 0px;

opacity: 0.6;
background: #444444;
border-top: 1px solid #000000;
border-bottom: 1px solid #000000;

font-size: 18px;
font-weight: bold;
}

div.toolbox div.timers {
clear: right;
div.toolbox {
float: right;
margin: 4px 10px 4px 10px;
padding: 4px;
border: 1px solid #444444;
}
div.toolbox div.timers div.timer {
color: #990000;

div.toolbox div.player {
clear: right;
float: right;
margin: 4px 10px 4px 10px;
padding: 4px;
border: 1px solid #444444;

font-size: 13px;
}

div.toolbox div.selected {
clear: right;
float: right;
margin: 4px 10px 4px 10px;
padding: 4px;
border: 1px solid #444444;
}
div.toolbox div.timers {
clear: right;
float: right;
margin: 4px 10px 4px 10px;
padding: 4px;
border: 1px solid #444444;
}
div.toolbox div.timers div.timer {
color: #990000;
}
div.toolbox div.timers div.action {
margin: 4px;
color: #0000ff;
font-size: 11px;
cursor: pointer;
}
div.toolbox div.timers div.action:hover {
font-weight: bold;
text-decoration: underline;
}

div.toolbox div.selected {
clear: right;
float: right;
margin: 4px 10px 4px 10px;
padding: 4px;
border: 1px solid #444444;
}


div.grid {
Expand Down Expand Up @@ -149,28 +184,47 @@ div.grid {
width: 44px;
height: 44px;
}

div.grid div.grid_row div.tile_selected {
background: url('../graphics/battle/tile_selected.png') top left no-repeat;
}
div.grid div.grid_row div.tile_move_near {
background: url('../graphics/battle/tile_move_near.png') top left no-repeat;
div.grid div.grid_row div.tile_move {
background: url('../graphics/battle/tile_move.png') top left no-repeat;
}
div.grid div.grid_row div.tile_move_far {
background: url('../graphics/battle/tile_move_far.png') top left no-repeat;
div.grid div.grid_row div.tile_range {
background: url('../graphics/battle/tile_range.png') top left no-repeat;
}
div.grid div.grid_row div.tile_attack {
background: url('../graphics/battle/tile_attack.png') top left no-repeat;
}

div.grid div.grid_row div.tile div.unit {
float: left;
width: 32px;
height: 38px;
position: relative;
width: 40px;
height: 40px;
margin: 0px -40px -40px 4px;

margin-left: 6px;
margin-top: -8px;
background-position: center center;
background-repeat: no-repeat;
}
div.grid div.grid_row div.tile div.unit_player {
background-image: url('../graphics/battle/unit_player.gif');
}
div.grid div.grid_row div.tile div.unit_enemy {
background-image: url('../graphics/battle/unit_enemy.gif');
}

background: url('../graphics/battle/ofzza.gif') top left no-repeat;
div.grid div.grid_row div.tile div.distance {
position: relative;
width: 44px;
margin: 32px 0px 0px 0px;

text-align: center;
font-size: 9px;
color: #ffffff;
}
div.grid div.grid_row div.tile:hover div.distance {
color: #000000;
}

div.grid div.grid_row div.tile div.info {
Expand Down
Binary file removed res/graphics/battle/ofzza.gif
Binary file not shown.
Binary file removed res/graphics/battle/sprite.png
Binary file not shown.
Binary file removed res/graphics/battle/tile.psd
Binary file not shown.
File renamed without changes
File renamed without changes
Binary file added res/graphics/battle/unit_enemy.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/graphics/battle/unit_player.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 46 additions & 14 deletions res/js/bt_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,55 @@
// Configuration namespace
// ---------------------------------------------------------------------------------------------------------------------

// Holds root path of URL where application is deployed
bt.config.urls = {
clientUrl : '/battle/static/btjs2/',
servicesUrl : '/battle/'
}
// Configure root path of URL where application is deployed
// -----------------------------------------------------------------------------------------------------------------
bt.config.urls = {
// Set client-side URL path
clientUrl : '/battle/static/btjs2/',
// Set server-side URL path
servicesUrl : '/battle/'
}

// Set poling
bt.config.poling.minimalIntervalBetweenPolls = 2000;
// Set poling
// -----------------------------------------------------------------------------------------------------------------

// Set debugging options
bt.debugging.events.publishToConsole = false;
bt.debugging.model.verifyModelConstructors = true;
// Set value for minimal time interval between polling same service in [ms]
bt.config.poling.minimalIntervalBetweenPolls = 2000;

// Set debugging options
// -----------------------------------------------------------------------------------------------------------------

// Set if events are pushed to console
bt.debugging.events.publishToConsole = true;
// Set if model constructors will test received properties
bt.debugging.model.verifyModelConstructors = true;

// BattleField configuration namespace
// ---------------------------------------------------------------------------------------------------------------------

bt.config.game.battle.styles.selected = 'tile_selected';
bt.config.game.battle.styles.move_near = 'tile_move_near';
bt.config.game.battle.styles.move_far = 'tile_move_far';
bt.config.game.battle.styles.attack = 'tile_attack';
// Set CSS Styles
// -----------------------------------------------------------------------------------------------------------------

// Selected tile CSS class name
bt.config.game.battle.styles.selected = 'tile_selected';
// Selected tile CSS class name
bt.config.game.battle.styles.move = 'tile_move';
// Selected tile CSS class name
bt.config.game.battle.styles.range = 'tile_range';
// Selected tile CSS class name
bt.config.game.battle.styles.attack = 'tile_attack';

// Player's unit CSS class name
bt.config.game.battle.styles.player = 'unit_player';
// Enemy unit CSS class name
bt.config.game.battle.styles.enemy = 'unit_enemy';

// Configure actions
// -----------------------------------------------------------------------------------------------------------------

// Set unit's move radius
bt.config.game.battle.actions.moveRadius = 2;
// Set if actions and movement can pass through other units
bt.config.game.battle.actions.jumpUnits = true;
// Set if player can attack his own units
bt.config.game.battle.actions.friendlyFire = true;
Loading

0 comments on commit 7443c8a

Please sign in to comment.