New/gameboard #8

Merged
Myxelium merged 2 commits from new/gameboard into master 2020-03-18 09:23:14 +00:00
4 changed files with 25 additions and 3 deletions
Showing only changes of commit f45aa57693 - Show all commits

View File

@@ -43,6 +43,7 @@
<div class="flexwrap"> <div class="flexwrap">
<div class="stats"> <div class="stats">
<div id="health"></div> <div id="health"></div>
<div id="timer-counter"><label id="minutes">00</label>:<label id="seconds">00</label></div>
<div id="container_r">Round:&nbsp;<div id="round"></div> <div id="container_r">Round:&nbsp;<div id="round"></div>
</div> </div>
<div id="container_r">&nbsp;Score:&nbsp;<div id="score">0</div> <div id="container_r">&nbsp;Score:&nbsp;<div id="score">0</div>
@@ -85,7 +86,7 @@
<img src="assets/textures/button_on.png" onclick="menu_clicks();uncheck_allowspin();document.getElementById('btn-on-spin').style.display = 'none';document.getElementById('btn-off-spin').style.display = 'block';" id="btn-on-spin" alt="off"> <img src="assets/textures/button_on.png" onclick="menu_clicks();uncheck_allowspin();document.getElementById('btn-on-spin').style.display = 'none';document.getElementById('btn-off-spin').style.display = 'block';" id="btn-on-spin" alt="off">
</div> </div>
<div id="button-text-01-spin"> <div id="button-text-01-spin">
Disable spinning board Disable spinning
</div> </div>
</div> </div>
<button onclick="menu_clicks();when_clicked_back();" class="menu-nav-button">Back</button> <button onclick="menu_clicks();when_clicked_back();" class="menu-nav-button">Back</button>
@@ -99,6 +100,7 @@
<script src="scripts/gameboard.js"></script> <script src="scripts/gameboard.js"></script>
<script src="scripts/sound.js"></script> <script src="scripts/sound.js"></script>
<script src="scripts/options.js"></script> <script src="scripts/options.js"></script>
<script src="scripts/timer.js"></script>
<!-- particles.js library --> <!-- particles.js library -->
<script src="http://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script> <script src="http://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="scripts/particles.js"></script> <script src="scripts/particles.js"></script>

View File

@@ -20,6 +20,7 @@ var no_fail_round = 0;
var round_values = 0; var round_values = 0;
function initiate() { // Call all the functions function initiate() { // Call all the functions
setInterval(setTime, 1000);
round_value(); round_value();
lifes(); lifes();
prep(); prep();

View File

@@ -21,11 +21,11 @@ function uncheck() {
} }
function check_allowspin() { function check_allowspin() {
allow_spin = true; allow_spin = true;
document.getElementById("button-text-01-spin").innerHTML = "Disable spinning board"; document.getElementById("button-text-01-spin").innerHTML = "Disable spinning";
} }
function uncheck_allowspin() { function uncheck_allowspin() {
allow_spin = false; allow_spin = false;
document.getElementById("button-text-01-spin").innerHTML = "Enable spinning board"; document.getElementById("button-text-01-spin").innerHTML = "Enable spinning";
} }
function cardspeed(){ function cardspeed(){
viewspeed = document.getElementById("card-speed-number-value").value; viewspeed = document.getElementById("card-speed-number-value").value;

19
scripts/timer.js Normal file
View File

@@ -0,0 +1,19 @@
var minutesLabel = document.getElementById("minutes");
var secondsLabel = document.getElementById("seconds");
var totalSeconds = 0;
function setTime() {
if(!health == 0){
++totalSeconds;
secondsLabel.innerHTML = pad(totalSeconds % 60);
minutesLabel.innerHTML = pad(parseInt(totalSeconds / 60));
}
}
function pad(val) {
var valString = val + "";
if (valString.length < 2) {
return "0" + valString;
} else {
return valString;
}
}