diff --git a/src/activities/babymatch/ActivityInfo.qml b/src/activities/babymatch/ActivityInfo.qml index d57395c54..925e5eee6 100644 --- a/src/activities/babymatch/ActivityInfo.qml +++ b/src/activities/babymatch/ActivityInfo.qml @@ -1,37 +1,37 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Pulkit Gupta * * Authors: * Pulkit Gupta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import GCompris 1.0 ActivityInfo { name: "babymatch/Babymatch.qml" difficulty: 1 icon: "babymatch/babymatch.svg" author: "Pulkit Gupta <pulkitgenius@gmail.com>" - demo: false + demo: true title: qsTr("Matching Items") description: qsTr("Drag and Drop the items to make them match") // intro: "Slide the images on their respective targets" goal: qsTr("Motor coordination. Conceptual matching.") prerequisite: qsTr("Cultural references.") manual: qsTr("In the main board area, a set of objects is displayed. In the vertical box (at the left of the main board) another set of objects is shown, each object in the group on the left matching exactly one object in the main board area. This game challenges you to find the logical link between these objects. How do they fit together? Drag each object to the correct red space in the main area.") credit: "" section: "discovery" } diff --git a/src/activities/babyshapes/ActivityInfo.qml b/src/activities/babyshapes/ActivityInfo.qml index 0bfe73041..f46de5c91 100644 --- a/src/activities/babyshapes/ActivityInfo.qml +++ b/src/activities/babyshapes/ActivityInfo.qml @@ -1,38 +1,38 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Pulkit Gupta * * Authors: * Pulkit Gupta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import GCompris 1.0 ActivityInfo { name: "babyshapes/Babyshapes.qml" difficulty: 1 icon: "babyshapes/babyshapes.svg" author: "Pulkit Gupta <pulkitgenius@gmail.com>" - demo: false + demo: true title: qsTr("Complete the puzzle") description: qsTr("Drag and Drop the shapes on their respective targets") // intro: "Slide the images on their respective targets" goal: "" prerequisite: "" manual: qsTr("Complete the puzzle by dragging each piece from the set of pieces on the left, to the matching space in the puzzle.") credit: qsTr("The dog is provided by Andre Connes and released under the GPL") section: "discovery" } diff --git a/src/activities/ballcatch/Ballcatch.qml b/src/activities/ballcatch/Ballcatch.qml index 9de142696..8584e3fc5 100644 --- a/src/activities/ballcatch/Ballcatch.qml +++ b/src/activities/ballcatch/Ballcatch.qml @@ -1,274 +1,277 @@ /* gcompris - Ballcatch.qml Copyright (C) 2014 Johnny Jazeix Bruno Coudoin: initial Gtk+ version This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ import QtQuick 2.1 import GCompris 1.0 import "../../core" import "../ballcatch" import "ballcatch.js" as Activity ActivityBase { id: activity onStart: { focus = true; } onStop: {} Keys.onPressed: { Activity.processKey(event) } pageComponent: Image { id: background signal start signal stop focus: true fillMode: Image.PreserveAspectCrop source: "qrc:/gcompris/src/activities/ballcatch/resource/beach1.svg" sourceSize.width: parent.width Component.onCompleted: { activity.start.connect(start) activity.stop.connect(stop) } QtObject { id: items property alias background: background property alias bar: bar property alias ball: ball property alias rightHand: rightHand property alias leftHand: leftHand property alias deltaPressedTimer: deltaPressedTimer /* when the corresponding arrow key is pressed, the following boolean pass to true and is reseted at the end of the level */ property bool leftPressed property bool rightPressed } onStart: { Activity.start(items) } onStop: { Activity.stop() } onWidthChanged: { leftHand.reinitPosition(); rightHand.reinitPosition(); ball.reinitBall(); } onHeightChanged: { leftHand.reinitPosition(); rightHand.reinitPosition(); ball.reinitBall(); } DialogHelp { id: dialogHelpLeftRight onClose: home() } Bar { id: bar content: BarEnumContent { value: help | home | level } onHelpClicked: { displayDialog(dialogHelpLeftRight) } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: home() } Bonus { id: bonus winSound: "qrc:/gcompris/src/activities/ballcatch/resource/tuxok.wav" looseSound: "qrc:/gcompris/src/activities/ballcatch/resource/youcannot.wav" Component.onCompleted: { win.connect(Activity.nextLevel) loose.connect(Activity.restartLevel) } + onStart: tux.opacity = 0 + onStop: tux.opacity = 1 } Image { id: tux x: background.width / 2 - width / 2 y: leftHand.y - height / 3 - height / 2 sourceSize.height: 200 * ApplicationInfo.ratio source: "qrc:/gcompris/src/activities/ballcatch/resource/tux.svg" + Behavior on opacity { PropertyAnimation { easing.type: Easing.InQuad; duration: 250 } } } Image { id: leftHand y: background.height - 1.5 * height z: 5 sourceSize.height: 150 * ApplicationInfo.ratio source: "qrc:/gcompris/src/activities/ballcatch/resource/hand.svg" NumberAnimation { id: leftHandAnimation target: leftHand; property: "x"; to: background.width/2 - leftHand.width - 5; duration: 1000 easing.type: Easing.InOutQuad } function animate(newTime) { leftHandAnimation.duration = newTime leftHandAnimation.start(); } function reinitPosition() { leftHand.x = background.width / 2 - width * 2 leftHand.y = background.height - 1.5 * height } MultiPointTouchArea { id: mouseAreaLeftShift anchors.fill: parent onTouchUpdated: { // left if(!items.leftPressed && !Activity.gameFinished) { Activity.leftShiftPressed(); items.leftPressed = true } } } } Image { id: rightHand mirror: true y: background.height - 1.5 * height z: 5 sourceSize.height: 150 * ApplicationInfo.ratio source: "qrc:/gcompris/src/activities/ballcatch/resource/hand.svg" function animate(newTime) { rightHandAnimation.duration = newTime rightHandAnimation.start(); } function reinitPosition() { rightHand.x = background.width / 2 + width rightHand.y = background.height - 1.5 * height } NumberAnimation { id: rightHandAnimation target: rightHand; property: "x"; to: background.width / 2 + 5; duration: 1000; easing.type: Easing.InOutQuad } MultiPointTouchArea { id: mouseAreaRightShift anchors.fill: parent onTouchUpdated: { // right if(!items.rightPressed && !Activity.gameFinished) { Activity.rightShiftPressed(); items.rightPressed = true } } } } Image { id: leftShift x: background.width / 4 - width y: rightHand.y - height / 2 source: "qrc:/gcompris/src/activities/ballcatch/resource/arrow_key.svg" opacity: items.leftPressed ? 1 : 0.5 visible: !ApplicationInfo.isMobile } Image { id: rightShift mirror: true x: background.width - background.width / 4 y: rightHand.y - height / 2 source: "qrc:/gcompris/src/activities/ballcatch/resource/arrow_key.svg" opacity: items.rightPressed ? 1 : 0.5 visible: !ApplicationInfo.isMobile } // Instructions BorderImage { id: bubble x: 10.0 y: tux.y border.left: 3 * ApplicationInfo.ratio border.top: 3 * ApplicationInfo.ratio border.right: 20 * ApplicationInfo.ratio border.bottom: 3 * ApplicationInfo.ratio source: "qrc:/gcompris/src/activities/ballcatch/resource/bubble.svg" width: tux.x - 10 height: instructions.height + 20 * ApplicationInfo.ratio // Remove the instructions when both keys has been pressed opacity: bar.level === 1 && !(items.leftPressed && items.rightPressed) ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 120 } } GCText { id: instructions anchors { left: parent.left right: parent.right verticalCenter: parent.verticalCenter leftMargin: 10 * ApplicationInfo.ratio rightMargin: 20 * ApplicationInfo.ratio } text: ApplicationInfo.isMobile ? qsTr("Tap both hands at the same time, " + "to make the ball go in a straight line.") : qsTr("Press left and right arrow keys at the same time, " + "to make the ball go in a straight line.") wrapMode: TextEdit.WordWrap horizontalAlignment: TextEdit.AlignHCenter verticalAlignment: TextEdit.AlignVCenter fontSize: regularSize } } function playSound(identifier) { activity.audioEffects.play("qrc:/gcompris/src/core/resource/sounds/"+ identifier + ".wav") } /* Timer starting when user first presses a first key. If still running when the user presses the other key, he wins ! */ Timer { id: deltaPressedTimer running: false; repeat: false onTriggered: { Activity.endTimer() ball.startAnimation() } } Ball { id: ball } } } diff --git a/src/activities/details/ActivityInfo.qml b/src/activities/details/ActivityInfo.qml index faa8fcd61..5f075d420 100644 --- a/src/activities/details/ActivityInfo.qml +++ b/src/activities/details/ActivityInfo.qml @@ -1,37 +1,37 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Pulkit Gupta * * Authors: * Pulkit Gupta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import GCompris 1.0 ActivityInfo { name: "details/Details.qml" difficulty: 1 icon: "details/details.svg" author: "Pulkit Gupta <pulkitgenius@gmail.com>" - demo: false + demo: true title: qsTr("Find the details") description: qsTr("Drag and Drop the shapes on their respective targets") // intro: "Slide the images on their respective targets" goal: "" prerequisite: "" manual: qsTr("Complete the puzzle by dragging each piece from the set of pieces on the left, to the matching space in the puzzle.") credit: qsTr("The images are from Wikimedia Commons.") section: "discovery" } diff --git a/src/activities/gletters/resource/default-nl.json b/src/activities/gletters/resource/default-nl.json index dd89890cb..ffc16287c 100644 --- a/src/activities/gletters/resource/default-nl.json +++ b/src/activities/gletters/resource/default-nl.json @@ -1,179 +1,220 @@ { "levels" : [ { "level" : "1", "words" : [ "a", "e", "i", "o", - "u" + "u", + "y" ] }, { "level" : "2", "words" : [ "b", "c", "d", "f", "g", + "h", + "j", + "k", "l", "m", "n", - "p", - "r", - "s", - "t" + "p" ] }, { "level" : "3", "words" : [ - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "0" + "m", + "n", + "p", + "q", + "r", + "s", + "t", + "v", + "w", + "x", + "z" ] }, { "level" : "4", "words" : [ "a", "b", "c", "d", "e", "f", "g", + "h", "i", + "j", + "k", "l", "m", "n", "o", "p", + "q", "r", "s", "t", "u", + "v", + "w", + "x", + "y", + "z" + ] + }, + { + "level" : "5", + "words" : [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" ] }, { - "level" : "5", + "level" : "6", "words" : [ "A", "E", "I", "O", - "U" + "U", + "Y" ] }, { - "level" : "6", + "level" : "7", "words" : [ "B", "C", "D", "F", "G", - "L", + "H", + "J", + "K", + "L" + ] + }, + { + "level" : "8", + "words" : [ "M", "N", "P", + "Q", "R", "S", - "T" + "T", + "V", + "W", + "X", + "Z" ] }, { - "level" : "7", + "level" : "9", "words" : [ - "A", "B", "C", "D", - "E", "F", "G", - "I", + "H", + "J", + "K", "L", "M", "N", - "O", "P", + "Q", "R", "S", "T", - "U", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "0" + "V", + "W", + "X", + "Z" ] }, { - "level" : "8", + "level" : "10", "words" : [ "a", "b", "c", "d", "e", "f", "g", + "h", "i", + "j", + "k", "l", "m", "n", "o", "p", + "q", "r", "s", "t", "u", + "v", + "w", + "x", + "y", + "z", "A", "B", "C", "D", "E", "F", "G", + "H", "I", + "J", + "K", "L", "M", "N", "O", "P", + "Q", "R", "S", "T", - "U" + "U", + "V", + "W", + "X", + "Y", + "Z" ] } ], "name" : "default-en", "locale" : "en", "description" : "English" } diff --git a/src/activities/imagename/ActivityInfo.qml b/src/activities/imagename/ActivityInfo.qml index e0a3d6e1d..d2206fbdf 100644 --- a/src/activities/imagename/ActivityInfo.qml +++ b/src/activities/imagename/ActivityInfo.qml @@ -1,36 +1,36 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Pulkit Gupta * * Authors: * Pulkit Gupta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import GCompris 1.0 ActivityInfo { name: "imagename/Imagename.qml" difficulty: 1 icon: "imagename/imagename.svg" author: "Pulkit Gupta <pulkitgenius@gmail.com>" - demo: false + demo: true title: qsTr("Image Name") description: qsTr("Drag and Drop each item above its name") // intro: "Slide the images on their respective targets" goal: qsTr("Vocabulary and reading") prerequisite: qsTr("Reading") manual: qsTr("Drag each image from the (vertical) box on the left to its (corresponding) name on the right. Click the OK button to check your answer.") section: "reading" } diff --git a/src/core/Bonus.qml b/src/core/Bonus.qml index 6306c1036..135513c51 100644 --- a/src/core/Bonus.qml +++ b/src/core/Bonus.qml @@ -1,153 +1,169 @@ /* GCompris - Bonus.qml * * Copyright (C) 2014 Bruno Coudoin * * Authors: * Bruno Coudoin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.2 import GCompris 1.0 // Requires the global property in the scope: // property GCAudio audioEffects, audioVoices /** * A QML component providing user feedback upon winning/loosing. * @ingroup components * * Usually triggered by an activity when a user has won/lost a level via the * @ref good / @ref bad methods. Bonus then provides visual and auditive * feedback to the user and emits the @ref win / @ref loose signals when * finished. * * Maintains a list of possible audio voice resources to be playebd back * upon winning/loosing events, and selects randomly from them when triggered. * * @inherit QtQuick.Image */ Image { id: bonus /** * type:string * Url of the audio resource to be used as winning sound. */ property string winSound: url + "sounds/bonus.wav" /** * type:string * Url of the audio resource to be used as loosing sound. */ property string looseSound + /** + * Emitted when the bonus starts + */ + signal start + + /** + * Emitted when the bonus stops + */ + signal stop + /** * Emitted when the win event is over. * * After the animation has finished. */ signal win /** * Emitted when the loose event is over. * * After the animation has finished. */ signal loose /// @cond INTERNAL_DOCS property string url: "qrc:/gcompris/src/core/resource/" property bool isWin: false property var winVoices: [ "voices-$CA/$LOCALE/misc/congratulation.$CA", "voices-$CA/$LOCALE/misc/great.$CA", "voices-$CA/$LOCALE/misc/good.$CA", "voices-$CA/$LOCALE/misc/awesome.$CA", "voices-$CA/$LOCALE/misc/fantastic.$CA", "voices-$CA/$LOCALE/misc/waytogo.$CA", "voices-$CA/$LOCALE/misc/super.$CA", "voices-$CA/$LOCALE/misc/perfect.$CA" ] property var looseVoices: [ "voices-$CA/$LOCALE/misc/check_answer.$CA" ] /// @endcond visible: true opacity: 0 anchors.fill: parent fillMode: Image.Pad z: 1000 - scale: ApplicationInfo.ratio + sourceSize.width: parent.width * 0.5 + sourceSize.height: parent.height * 0.7 /** * Triggers win feedback. * * Tries to play back a voice resource for winning, if not found fall back * to the winSound. * * @param name Type of win image to show. * Possible values are "flower", "gnu", "lion", "note", "smiley", "tux" */ function good(name) { if(!audioVoices.play( ApplicationInfo.getAudioFilePath( winVoices[Math.floor(Math.random()*winVoices.length)]))) if(winSound) audioEffects.play(winSound) source = url + "bonus/" + name + "_good.svg" isWin = true; + start() animation.start() } /** * Triggers loose feedback. * * Tries to play back a voice resource for loosing, if not found fall back * to the looseSound. * * @param name Type of win image to show. * Possible values are "flower", "gnu", "lion", "note", "smiley", "tux" */ function bad(name) { if(!audioEffects.play( ApplicationInfo.getAudioFilePath( looseVoices[Math.floor(Math.random()*looseVoices.length)]))) if(looseSound) audioEffects.play(looseSound) source = url + "bonus/" + name + "_bad.svg" isWin = false; + start() animation.start() } SequentialAnimation { id: animation NumberAnimation { target: bonus property: "opacity" from: 0; to: 1.0 duration: 1000 easing.type: Easing.InOutQuad } NumberAnimation { target: bonus property: "opacity" from: 1.0; to: 0 duration: 500 easing.type: Easing.InOutQuad } - onStopped: isWin ? win() : loose() + onStopped: { + bonus.stop() + isWin ? win() : loose() + } } }