[gnome-tetravex] Start the clock immediately on new game
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tetravex] Start the clock immediately on new game
- Date: Sat, 31 May 2014 02:54:55 +0000 (UTC)
commit a795295744d8bbae7c3057f837e20049051e62ac
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Fri May 30 21:53:16 2014 -0500
Start the clock immediately on new game
In some games, it makes sense to start the clock after the first move
has been completed. Tetravex is different: the first move requires a lot
of thought, and it ought to be counted against the player's time.
src/gnome-tetravex.vala | 3 +--
src/puzzle.vala | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-tetravex.vala b/src/gnome-tetravex.vala
index 2388485..f76d6ad 100644
--- a/src/gnome-tetravex.vala
+++ b/src/gnome-tetravex.vala
@@ -223,7 +223,7 @@ public class Tetravex : Gtk.Application
{
var pause = lookup_action ("pause") as SimpleAction;
pause.change_state (false);
- pause.set_enabled (false);
+ pause.set_enabled (true);
new_game_solve_stack.set_visible_child_name ("solve");
if (puzzle != null)
@@ -233,7 +233,6 @@ public class Tetravex : Gtk.Application
puzzle = new Puzzle (size);
puzzle.tick.connect (tick_cb);
puzzle.solved.connect (solved_cb);
- puzzle.tile_moved.connect (() => pause.set_enabled (true));
view.puzzle = puzzle;
tick_cb ();
diff --git a/src/puzzle.vala b/src/puzzle.vala
index b0071fc..f1b4185 100644
--- a/src/puzzle.vala
+++ b/src/puzzle.vala
@@ -149,6 +149,8 @@ public class Puzzle
tiles.remove (tile);
}
}
+
+ start_clock ();
}
public Tile? get_tile (uint x, uint y)
@@ -209,8 +211,6 @@ public class Puzzle
if (x0 == x1 && y0 == y1)
return;
- start_clock ();
-
var t0 = board[x0, y0];
var t1 = board[x1, y1];
board[x0, y0] = t1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]