Remove redundant code

This commit is contained in:
2024-10-05 13:28:28 +02:00
parent ee696c6292
commit 389e42b45d
+4 -6
View File
@@ -142,6 +142,9 @@ function stop_timing() {
function restart_game() {
game_finished = false;
mines_placed = false;
// Based on the level, we calculate the grid size and amount
// of mines. The height of the grid increases every two
// levels.
field_height = 8 + Math.floor(current_level / 2);
minefield_initialize();
update_particle_canvas_size();
@@ -157,11 +160,6 @@ function restart_game() {
}
function start_or_continue_game(level) {
// Based on the level, we calculate the grid size and amount
// of mines. The height of the grid increases every two
// levels.
current_level = level;
field_height = 8 + Math.floor(current_level / 2);
let minefield_html = localStorage.getItem(current_level + "-minefield_html");
$("#level").innerText = current_level;
if (minefield_html == null) {
@@ -346,4 +344,4 @@ function lose_game() {
cell.innerText = "";
}
});
}
}