Commit e1111bd9 authored by Jyrki's avatar Jyrki 🐾
Browse files

the game modal

parent 33096827
......@@ -53,15 +53,17 @@ updateCounters = ->
$('span#people-shelter').html window.gameVars.people.shelter
$('span#builds-fields').html window.gameVars.fields.count
$('span#builds-cattle').html window.gameVars.cattleGrids.count
if window.gameVars.gold <= 0 || window.gameVars.wheat.count <= 0
$.growl {
title: "The Game"
message: "You lost it"
}
window.clearInterval evtim
$('span#valuables-gold').html 0 if window.gameVars.gold < 0
$('span#goods-wheat').html 0 if window.gameVars.wheat.count < 0
$('#game-over-modal').modal 'show'
# Krieg
kriegTimer = ->
die = Math.floor((Math.random() * 10000000) % 2) == 0
# random event
eventTimer = ->
......
......@@ -59,6 +59,22 @@
</div><!--/.navbar-collapse -->
</div>
</div>
<div class="modal fade" id="game-over-modal" tabindex="-1" role="dialog" aria-labelledby="game-over-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">The Game</h4>
</div>
<div class="modal-body">
<p>You lost it.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">;___;</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="container">
<div class="row">
<div class="col-md-4">
......@@ -103,6 +119,6 @@
</div>
</div>
</div>
</div> <!-- /container -->
</div> <!-- /container -->
</body>
</html>
// Generated by CoffeeScript 1.7.1
(function() {
var eventTimer, evtim, initItem, updateCounters;
var eventTimer, evtim, initItem, kriegTimer, updateCounters;
initItem = function(defaultCount, consumable) {
var retobj;
......@@ -53,20 +53,22 @@
$('span#builds-fields').html(window.gameVars.fields.count);
$('span#builds-cattle').html(window.gameVars.cattleGrids.count);
if (window.gameVars.gold <= 0 || window.gameVars.wheat.count <= 0) {
$.growl({
title: "The Game",
message: "You lost it"
});
window.clearInterval(evtim);
if (window.gameVars.gold < 0) {
$('span#valuables-gold').html(0);
}
if (window.gameVars.wheat.count < 0) {
return $('span#goods-wheat').html(0);
$('span#goods-wheat').html(0);
}
return $('#game-over-modal').modal('show');
}
};
kriegTimer = function() {
var die;
return die = Math.floor((Math.random() * 10000000) % 2) === 0;
};
eventTimer = function() {
var ev, f, g, i, message, title, w;
ev = Math.floor((Math.random() * 10000000) % 7);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment