[gcompris/gcomprixogoo] In planegame now the numbers are spoken when the plane hit the correct cloud.
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris/gcomprixogoo] In planegame now the numbers are spoken when the plane hit the correct cloud.
- Date: Sun, 5 Dec 2010 18:09:15 +0000 (UTC)
commit acbb8a34b3bb6fd83bf09a10bb1bb87b3a41605a
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Sun Dec 5 11:40:52 2010 +0100
In planegame now the numbers are spoken when the plane hit the correct cloud.
src/planegame-activity/planegame.c | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/src/planegame-activity/planegame.c b/src/planegame-activity/planegame.c
index 6ce46a7..dc99268 100644
--- a/src/planegame-activity/planegame.c
+++ b/src/planegame-activity/planegame.c
@@ -48,6 +48,7 @@ static gint planegame_drop_items (GtkWidget *widget, gpointer data);
static gint planegame_move_items (GtkWidget *widget, gpointer data);
static void planegame_destroy_all_items(void);
static void planegame_next_level(void);
+static void planegame_speak_number(int number);
static guint32 fallSpeed = 0;
static double speed = 0.0;
@@ -141,6 +142,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
gcomprisBoard->level = 1;
gcomprisBoard->maxlevel = 2;
gc_bar_set(GC_BAR_LEVEL);
+ gc_bar_location(10, -1, 0.6);
planegame_next_level();
@@ -341,7 +343,7 @@ static void planegame_cloud_colision(GooCanvasItem *item)
if(plane_target == number)
{
- gc_sound_play_ogg ("sounds/gobble.wav", NULL);
+ planegame_speak_number(number);
plane_target++;
goo_canvas_item_remove(item);
@@ -454,7 +456,7 @@ static GooCanvasItem *planegame_create_item(GooCanvasItem *parent)
svg_handle = gc_rsvg_load("planegame/cloud.svgz");
rsvg_handle_get_dimensions(svg_handle, &dimension);
- y = (g_random_int()%(BOARDHEIGHT -
+ y = (g_random_int()%(BOARDHEIGHT - 40 -
(guint)(dimension.height * imageZoom)));
goo_canvas_item_translate(itemgroup,
@@ -521,3 +523,27 @@ static gint planegame_drop_items (GtkWidget *widget, gpointer data)
return (FALSE);
}
+/** Play the audio number given in @number
+ */
+static void
+planegame_speak_number(int number)
+{
+ /* Play the audio level number */
+ gchar *number_str = g_strdup_printf("%d", number);
+
+ if ( number < 10 )
+ {
+ /* Set the number as unicode */
+ gchar *level_str = gc_sound_alphabet(number_str);
+ g_free(number_str);
+ number_str = level_str;
+ }
+
+ gchar *audio_str = g_strdup_printf("voices/$LOCALE/alphabet/%s", number_str);
+
+ gc_sound_play_ogg(audio_str, NULL);
+
+ g_free(number_str);
+ g_free(audio_str);
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]