Skip to content

Commit

Permalink
Updated castle upgrade images. Updated gold earning algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
Robison authored and Robison committed Mar 1, 2017
1 parent 36c256f commit 374837b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
12 changes: 12 additions & 0 deletions default.css
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,15 @@ a:hover {
width:48px;
height:48px;
}
.fort {
margin-top:-0.8em;
width:64px;
height:64px;
margin-left:-0.6em;
}
.fortress {
margin-top:-0.7em;
width:64px;
height:64px;
margin-left:-0.6em;
}
15 changes: 13 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,14 +853,25 @@ function updateMapDisplay(gameState) {

// right color and right number of levels (corresponding to upgrade level)
var templeLevels = temple.u ? (temple.l + 3) : 2;
while (element) {
console.log("Temple Level: "+templeLevels);
console.dir(temple.e);
var imgs = ['castle', 'fort', 'fortress'];
element = temple.e.firstChild;
element.src = 'img/' + imgs[templeLevels - 2] + '.png';
element.classList.remove("castle");
element.classList.remove("fort");
element.classList.remove("fortress");
element.classList.add(imgs[templeLevels - 2]);

/*
while (element) {
element.style.display = (templeLevels > 0) ? 'block' : 'none';
// element.style.background = temple.u ? temple.u.b : '#999';
templeLevels--;
element = element.firstChild;
}

*/
// which cursor should we use?
var templeOwner = owner(gameState, temple.r);
temple.e.style.cursor = (appState == APP_INGAME) ? ((templeOwner == activePlayer(gameState)) ? 'zoom-in' : 'help') : 'default';
Expand Down

0 comments on commit 374837b

Please sign in to comment.