Skip to content

Commit

Permalink
Add prize images to scoreboard on puzzle template
Browse files Browse the repository at this point in the history
  • Loading branch information
celeritas17 committed Jan 28, 2014
1 parent fe40b62 commit 1d02a26
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ db.sqlite3
*.png
*.jpeg
*.gif

*.svg

10 changes: 7 additions & 3 deletions assets/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,19 @@ body{
float:right;
}

#lives{
#lives, #prizes{
margin:auto;
position:relative;
width:275px;
height:125px;
height:60px;
float:left;
}

#prizes{
margin-bottom: 10px;
}

.life{
float:left;
margin:10px 10px 10px 30px;
}

8 changes: 7 additions & 1 deletion assets/js/snacMan.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,23 @@ $(function(){
dieing = true;
toggle_picture("cell", cell);
toggle_picture("bad_cell", bad_cell);

// Reset positions for bad guy and good guy
cell = 0;
bad_cell = row_size*col_size - 1;

toggle_picture("bad_cell", bad_cell);

var die_timeout = function(i){
setTimeout(function(){
toggle_picture("cell", cell);
}, i*100);
};

setTimeout(function(){
dieing = false;
}, 1000)
}, 1000);

for (var i = 0; i < 11; i++){
die_timeout(i);
}
Expand Down
5 changes: 5 additions & 0 deletions puzzles/templates/puzzle.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ <h2><em>{{puzzle.title}}</em></h2>
<img class="life" id="life2" src="{% static "assets/img/eat1.png" %}" />
<img class="life" id="life3" src="{% static "assets/img/eat1.png" %}" />
</div>
<div id="prizes">
<img class="life" id="prize3" src="{% static "assets/img/circle.svg" %}" />
<img class="life" id="prize3" src="{% static "assets/img/circle.svg" %}" />
<img class="life" id="prize3" src="{% static "assets/img/circle.svg" %}" />
</div>

{% endblock %}

10 changes: 7 additions & 3 deletions static/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,19 @@ body{
float:right;
}

#lives{
#lives, #prizes{
margin:auto;
position:relative;
width:275px;
height:125px;
height:60px;
float:left;
}

#prizes{
margin-bottom: 10px;
}

.life{
float:left;
margin:10px 10px 10px 30px;
}

8 changes: 7 additions & 1 deletion static/js/snacMan.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,23 @@ $(function(){
dieing = true;
toggle_picture("cell", cell);
toggle_picture("bad_cell", bad_cell);

// Reset positions for bad guy and good guy
cell = 0;
bad_cell = row_size*col_size - 1;

toggle_picture("bad_cell", bad_cell);

var die_timeout = function(i){
setTimeout(function(){
toggle_picture("cell", cell);
}, i*100);
};

setTimeout(function(){
dieing = false;
}, 1000)
}, 1000);

for (var i = 0; i < 11; i++){
die_timeout(i);
}
Expand Down

0 comments on commit 1d02a26

Please sign in to comment.