seed r281 - trunk/examples/lightsoff



Author: hortont
Date: Fri Nov 21 18:44:25 2008
New Revision: 281
URL: http://svn.gnome.org/viewvc/seed?rev=281&view=rev

Log:
Fix bug where you could break Lights Off by clicking too quickly on the 
arrows. 


Modified:
   trunk/examples/lightsoff/arrow.js
   trunk/examples/lightsoff/board.js

Modified: trunk/examples/lightsoff/arrow.js
==============================================================================
--- trunk/examples/lightsoff/arrow.js	(original)
+++ trunk/examples/lightsoff/arrow.js	Fri Nov 21 18:44:25 2008
@@ -1,5 +1,8 @@
 function pushed_arrow()
 {
+	if(animating_board)
+		return true;
+		
 	// TODO: Need to check that click count is 1
 	var direction = (this.flipped ? 1 : -1);
 	

Modified: trunk/examples/lightsoff/board.js
==============================================================================
--- trunk/examples/lightsoff/board.js	(original)
+++ trunk/examples/lightsoff/board.js	Fri Nov 21 18:44:25 2008
@@ -23,6 +23,10 @@
 function delete_board(timeline, board)
 {
 	board.destroy();
+	
+	animating_board = false;
+	
+	return true;
 }
 
 function win_animation()
@@ -55,6 +59,7 @@
 						-(sign)*((!direction) * board_size));
 	
 	remove_timeline.signal.completed.connect(delete_board, null, board);
+	animating_board = true;
 	fadeline.start();
 	
 	board = new_board;
@@ -79,6 +84,7 @@
 	Clutter.effect_fade(effect, board, 0);
 	
 	remove_timeline.signal.completed.connect(delete_board, null, board);	
+	animating_board = true;
 	fadeline.start();
 	
 	board = new_board;
@@ -86,6 +92,9 @@
 
 function check_won (timeline, light)
 {
+	if(animating_board)
+		return true;
+		
 	in_fade = false;
 	
 	if(light.get_parent().cleared() && !in_setup)
@@ -173,6 +182,7 @@
     },
     instance_init: function(klass)
     {
+    	animating_board = false;
     	in_fade = false;
     	
 		this.lights = new Array();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]