[gcompris/gcomprixogoo] Added a bonus flower feedback in watercycle to let the children knows he completed the level.
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris/gcomprixogoo] Added a bonus flower feedback in watercycle to let the children knows he completed the level.
- Date: Sun, 12 Dec 2010 11:48:47 +0000 (UTC)
commit 6e8cc051408ec899ecf8212f28f8eec19e911490
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Sun Dec 12 12:47:10 2010 +0100
Added a bonus flower feedback in watercycle to let the children knows he completed the level.
Thanks to Clara Coudoin for the feedback, it is great to have close beta testers.
src/watercycle-activity/watercycle.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/watercycle-activity/watercycle.py b/src/watercycle-activity/watercycle.py
index 5d62536..683517d 100644
--- a/src/watercycle-activity/watercycle.py
+++ b/src/watercycle-activity/watercycle.py
@@ -22,6 +22,7 @@ import gcompris.utils
import gcompris.anim
import gcompris.skin
import gcompris.sound
+import gcompris.bonus
import gtk
import gtk.gdk
@@ -47,6 +48,9 @@ class Gcompris_watercycle:
# Need to manage the timers to quit properly
self.waterlevel_timer = 0
+ # Used to display the bonus a single time
+ self.you_won = False
+
gcompris.sound.play_ogg("sounds/Harbor1.wav", "sounds/Harbor3.wav")
# Create our rootitem. We put each canvas item in it so at the end we
@@ -476,6 +480,9 @@ class Gcompris_watercycle:
if (self.waterlevel > self.waterlevel_min) and self.showerbutton:
self.tuxshowerwateritem.props.visibility = goocanvas.ITEM_VISIBLE
+ if not self.you_won:
+ gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.FLOWER)
+ self.you_won = True
else:
self.tuxshowerwateritem.props.visibility = goocanvas.ITEM_INVISIBLE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]