Skip to content

Commit

Permalink
differentiates b/w discovered and undiscovered shrines now
Browse files Browse the repository at this point in the history
  • Loading branch information
jbbieber1127 committed Apr 4, 2019
1 parent 896b22f commit 507d5b7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1>(WORK IN PROGRESS) Interactive Sekiro Map by John Bieber - Inspired by: <a h
</div>
</body>

<script src="js/worldMap.js"></script>
<script src="js/worldMap.js?1000"></script>
<script src="js/chart.js?1000"></script>

</html>
47 changes: 30 additions & 17 deletions js/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,23 +266,36 @@ let drawMap = () => {
continue;
}
if(type == 'shrine'){
let img = new Image();
img.onload = () => {
let height = img.height;
let width = img.width;
svg.append('image')
.attr('x', x - width/2)
.attr('y', y - height/2 - 25) // 25 is an arbitrary offset for style
.attr('xlink:href', img.src);
};
img.src = image_dir + 'shrine_discovered.png';
svg.append('circle')
.attr('cx', x)
.attr('cy', y)
.attr('r', type_space['shrine'])
.attr('fill', 'none')
.attr('stroke-width', 5)
.attr('stroke', 'LightBlue');
if(discovered[i]){
let img = new Image();
img.onload = () => {
let height = img.height;
let width = img.width;
svg.append('image')
.attr('x', x - width/2)
.attr('y', y - height/2 - 25) // 25 is an arbitrary offset for style
.attr('xlink:href', img.src);
};
img.src = image_dir + 'shrine_discovered.png';
svg.append('circle')
.attr('cx', x)
.attr('cy', y)
.attr('r', type_space['shrine'])
.attr('fill', 'none')
.attr('stroke-width', 5)
.attr('stroke', 'LightBlue');
}else{
let img = new Image();
img.onload = () => {
let height = img.height;
let width = img.width;
svg.append('image')
.attr('x', x - width/2)
.attr('y', y - height/2 - 25) // 25 is an arbitrary offset for style
.attr('xlink:href', img.src);
};
img.src = image_dir + 'shrine_undiscovered.png';
}
}else if(type == 'encounter'){
svg.append('circle')
.attr('cx', x)
Expand Down

0 comments on commit 507d5b7

Please sign in to comment.