diff --git a/src/activities/hydroelectric/ActivityInfo.qml b/src/activities/hydroelectric/ActivityInfo.qml index 033d0929b..bf21f6504 100755 --- a/src/activities/hydroelectric/ActivityInfo.qml +++ b/src/activities/hydroelectric/ActivityInfo.qml @@ -1,34 +1,34 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Sagar Chand Agarwal * * 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: "hydroelectric/Hydroelectric.qml" difficulty: 1 icon: "hydroelectric/hydroelectric.svg" author: "Sagar Chand Agarwal" demo: true title: qsTr("Hydro-Electricity") - description: qsTr("Tux has come back from a long fishing party on his boat.Bring the electrical system back up so he can have light in his home. ") - //intro: "put here in comment the text for the intro voice" + description: qsTr("Tux has come back from a long fishing party on his boat. Bring the electrical system back up so he can have light in his home. ") + //intro: "Click on the different stages that go to make up the power supply. " goal: qsTr("Learn about an electrical system based on renewable energy. ") manual: qsTr("Click on different active elements : sun, cloud, dam, solar array, wind farm and transformers, in order to reactivate the entire electrical system. When the system is back up and Tux is in his home, push the light button for him. To win you must switch on all the consumers while all the producers are up. ") prerequisite: "none" credit: qsTr("Drawing by Stephane Cabaraux. ") section: "experiments" } diff --git a/src/activities/hydroelectric/CMakeLists.txt b/src/activities/hydroelectric/CMakeLists.txt index 5a49eb668..9dce61ca9 100755 --- a/src/activities/hydroelectric/CMakeLists.txt +++ b/src/activities/hydroelectric/CMakeLists.txt @@ -1 +1 @@ -GCOMPRIS_ADD_RCC(activities/hydroelectric *.qml *.svg *.js resource/*) +GCOMPRIS_ADD_RCC(activities/hydroelectric *.qml *.svg *.js resource/* ) diff --git a/src/activities/hydroelectric/Hydroelectric.qml b/src/activities/hydroelectric/Hydroelectric.qml index 6e24a946d..6b6622a58 100755 --- a/src/activities/hydroelectric/Hydroelectric.qml +++ b/src/activities/hydroelectric/Hydroelectric.qml @@ -1,853 +1,1080 @@ /* GCompris - hydroelectric.qml * * Copyright (C) 2015 Sagar Chand Agarwal * * Authors: * Bruno Coudoin (GTK+ version) * Sagar Chand Agarwal (Qt Quick port) * * 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 "hydroelectric.js" as Activity ActivityBase { id: activity onStart: focus = true onStop: {} property string url: "qrc:/gcompris/src/activities/hydroelectric/resource/" property int oldWidth: width onWidthChanged: { oldWidth: width } property int oldHeight: height onHeightChanged: { oldHeight: height } pageComponent: Item { id: background anchors.fill: parent signal start signal stop Component.onCompleted: { activity.start.connect(start) activity.stop.connect(stop) } // Add here the QML items you need to access in javascript QtObject { id: items property Item main: activity.main property alias background: background property alias bar: bar property alias bonus: bonus property alias trigger: trigger } IntroMessage { z: 20 anchors { top: parent.top topMargin: 10 right: parent.right rightMargin: 5 left: parent.left leftMargin: 5 } intro:["", - qsTr("Tux has come back from a long fishing party on his boat.Bring the electrical system back up so he can have light in his home."), + qsTr("Tux has come back from a long fishing party on his boat. Bring the electrical system back up so he can have light in his home. "), qsTr("Click on different active elements : sun, cloud, dam, solar array, wind farm and transformers, in order to reactivate the entire electrical system."), - qsTr("When the system is back up and Tux is in his home, push the light button for him. To win you must switch on all the consumers while all the producers are up."), - qsTr("Learn about an electrical system based on renewable energy.Enjoy. "), + qsTr("When the system is back up and Tux is in his home, push the light button for him. To win you must switch on all the consumers while all the producers are up. "), + qsTr("Learn about an electrical system based on renewable energy. Enjoy. "), "" ] } Timer { id: trigger onTriggered: { anim.running= true sun_area.visible= true + wind_anim.running= true } } Image { id: sky anchors.top: parent.top sourceSize.width: parent.width source: activity.url + "sky.svg" height: (background.height - landscape.paintedHeight) / 2 + landscape.paintedHeight * 0.3 } Image { id: sea anchors { left: parent.left bottom: parent.bottom } sourceSize.width: parent.width source: activity.url + "sea.svg" height : (background.height - landscape.paintedHeight) / 2 + landscape.paintedHeight * 0.7 } Image { id: landscape anchors.fill: parent sourceSize.width: parent.width sourceSize.height: parent.height source: activity.url + "landscape.svg" } Image { id: tuxboat opacity: 1 source: activity.url + "boat.svg" sourceSize.width: root.width*0.15 sourceSize.height: root.height*0.15 anchors{ bottom: parent.bottom bottomMargin: 15 } x:0 z:20 NumberAnimation on x { id: anim running: false to: root.width - tuxboat.width duration: 15000 onRunningChanged: { if(!anim.running) { tuxboat.opacity = 0 tuxparked.opacity = 1 tuxoff.visible= true } } } } Image { id: tuxparked source: activity.url + "boat_parked.svg" sourceSize.width: parent.width*0.15 sourceSize.height: parent.height*0.15 opacity: 0 anchors { right: parent.right bottom: parent.bottom bottomMargin: 20 } z: 20 } Image { id: sun source: activity.url + "sun.svg" sourceSize.width: parent.width*0.05 anchors { left: parent.left top: parent.top leftMargin: parent.width*0.05 topMargin: parent.height*0.30 } MouseArea { id: sun_area anchors.fill: sun visible: false onClicked: { background.state= "up" sun_area.visible= false } } } Image { id: mask source: activity.url + "mask.svg" sourceSize.width: parent.width*0.05 anchors{ left: parent.left top: parent.top leftMargin: parent.width*0.05 topMargin: parent.height*0.32 } } Image { id: vapor opacity: 0 state: "vapor" source: activity.url + "vapor.svg" sourceSize.width: parent.width*0.05 anchors { top: mask.bottom left: parent.left leftMargin: parent.width*0.05 } } Image { id: cloud2 opacity: 0 source: activity.url + "cloud.svg" sourceSize.width: parent.width * 0.20 sourceSize.height: parent.height*0.10 anchors { left: parent.left top: parent.top leftMargin: 0.35*parent.width } Image { id: rain source: activity.url + "rain.svg" height:cloud2.height*2 width: cloud2.width anchors { top: cloud2.bottom } visible: false } } Image { id: cloud opacity: 0 source: activity.url + "cloud.svg" sourceSize.width: parent.width * 0.20 sourceSize.height: parent.height*0.10 anchors { left: parent.left top: parent.top leftMargin: 0.05*parent.width } MouseArea { anchors.fill: cloud onClicked: { background.state= "down" cloud2.opacity= 1 river.visible= true anim2.running= true } } } //river and reservoir plotting Image { id: river source: activity.url + "river.svg" width: parent.width*0.415 height: parent.height*0.74 anchors { top: parent.top left: parent.left topMargin: parent.height*0.1775 leftMargin: parent.width*0.2925 } visible: false } Image { id: reservoir1 - source: activity.url + "reservoir1.svg" + source: activity.url + "hydroelectric/reservoir1.svg" width: parent.width*0.07 height: parent.height*0.15 anchors { top: parent.top left: parent.left topMargin: parent.height*0.29 leftMargin: parent.width*0.315 } opacity: 0 } Image { id: reservoir2 - source: activity.url + "reservoir2.svg" + source: activity.url + "hydroelectric/reservoir2.svg" width: parent.width*0.07 height: parent.height*0.15 anchors { top: parent.top left: parent.left topMargin: parent.height*0.29 leftMargin: parent.width*0.312 } opacity: 0 } Image { id: reservoir3 - source: activity.url + "reservoir3.svg" + source: activity.url + "hydroelectric/reservoir3.svg" width: parent.width*0.12 height: parent.height*0.155 anchors { top: parent.top left: parent.left topMargin: parent.height*0.29 leftMargin: parent.width*0.285 } opacity: 0 } Image { id: reservoir4 - source: activity.url + "reservoir4.svg" + source: activity.url + "hydroelectric/reservoir4.svg" width: parent.width*0.155 height: parent.height*0.16 anchors { top: parent.top left: parent.left topMargin: parent.height*0.29 leftMargin: parent.width*0.27 } opacity: 0 } Image { id: reservoir5 - source: activity.url + "reservoir5.svg" + source: activity.url + "hydroelectric/reservoir5.svg" width: parent.width*0.2 height: parent.height*0.17 anchors { top: parent.top left: parent.left topMargin: parent.height*0.29 - leftMargin: parent.width*0.25 + leftMargin: parent.width*0.245 } opacity: 0 } SequentialAnimation { id: anim2 running: false PropertyAnimation{ target: reservoir1 property: "opacity" to: 1 } PauseAnimation { duration: 250 } PropertyAnimation{ target: reservoir2 property: "opacity" to: 1 } PauseAnimation { duration: 500 } PropertyAnimation{ target: reservoir3 property: "opacity" to: 1 } PauseAnimation { duration: 500 } PropertyAnimation{ target: reservoir4 property: "opacity" to: 1 } PropertyAnimation{ target: reservoir5 property: "opacity" to: 1 } onRunningChanged: { if(!anim2.running) { rain.visible= false cloud2.opacity= 0 dam_area.visible= true } } } //dam,transformer and wires Image { id: dam - source: activity.url + "dam.svg" + source: activity.url + "hydroelectric/dam.svg" width: river.width*0.12 sourceSize.height: parent.height*0.08 anchors { left: parent.left top: parent.top leftMargin: parent.width*0.33 topMargin: parent.height*0.42 } MouseArea{ id: dam_area visible: false anchors.fill: dam onClicked:{ damwire.visible= true anim3.running= true } } } SequentialAnimation { id: anim3 running: false PropertyAnimation{ target: reservoir5 property: "opacity" to: 0 } PauseAnimation { duration: 250 } PropertyAnimation{ target: reservoir4 property: "opacity" to: 0 } PauseAnimation { duration: 500 } PropertyAnimation{ target: reservoir3 property: "opacity" to: 0 } PauseAnimation { duration: 500 } PropertyAnimation{ target: reservoir2 property: "opacity" to: 0 } PropertyAnimation{ target: reservoir1 property: "opacity" to: 0 } onRunningChanged: { if(!anim3.running) { stepup1_area.visible= true dam_area.visible= true } } } Image { id: damwire - source: activity.url+ "damwire.svg" + source: activity.url+ "hydroelectric/damwire.svg" sourceSize.width: parent.width sourceSize.height: parent.height anchors.fill: parent visible: false } Image { id: stepup1 source: activity.url + "transformer.svg" sourceSize.width: parent.width*0.06 height: parent.height*0.09 anchors { top: parent.top left: parent.left topMargin: parent.height*0.435 leftMargin: parent.width*0.44 } MouseArea { id: stepup1_area visible: false anchors.fill: stepup1 onClicked: { stepupwire1.visible= true stepdown_area.visible= true } } } Image { id: stepupwire1 - source: activity.url + "stepupwire.svg" + source: activity.url + "hydroelectric/stepupwire.svg" sourceSize.width: parent.width sourceSize.height: parent.height anchors.fill: parent visible: false } Image { id: stepdown source: activity.url + "transformer.svg" sourceSize.width: parent.width*0.06 height: parent.height*0.09 anchors { top: parent.top left: parent.left topMargin: parent.height*0.41 leftMargin: parent.width*0.72 } MouseArea { id: stepdown_area visible: false anchors.fill: stepdown onClicked: { stepdownwire.visible= true resident_area.visible= true off_area.visible= true } } } Image { id: stepdownwire - source: activity.url + "stepdown.svg" + source: activity.url + "hydroelectric/stepdown.svg" sourceSize.width: parent.width anchors.fill: parent visible: false } // residents on and off section activated after step-down click Image { id: residentoff source: activity.url + "off.svg" sourceSize.height: parent.height*0.05 sourceSize.width: parent.height*0.05 anchors { left: parent.left top: parent.top leftMargin: parent.width*0.60 topMargin: parent.height*0.65 } MouseArea { id: resident_area visible: false anchors.fill: residentoff onClicked: { residentlights.visible= true residentoff.visible= false residenton.visible= true } } } Image { id: residenton visible: false source: activity.url + "on.svg" sourceSize.height: parent.height*0.05 sourceSize.width: parent.height*0.05 anchors { left: parent.left top: parent.top leftMargin: parent.width*0.60 topMargin: parent.height*0.65 } MouseArea { anchors.fill: residenton onClicked: { residentlights.visible= false residenton.visible= false residentoff.visible= true } } } Image { id: residentlights source: activity.url+ "residenton.svg" sourceSize.width: parent.width sourceSize.height: parent.height anchors.fill: parent visible: false } //tuxoff is visible when tuxboat animation stops and on is activated after stepdown is activated. Image { id: tuxoff source: activity.url + "lightsoff.svg" height: parent.height*0.2 width: parent.width*0.15 anchors { bottom: parent.bottom right: parent.right bottomMargin: parent.height* 0.3 rightMargin: parent.width*0.02 } visible: false Image { id: off source: activity.url + "off.svg" sourceSize.height: parent.height*0.20 sourceSize.width: parent.height*0.20 anchors { right: tuxoff.right top: tuxoff.top rightMargin: tuxoff.width*0.20 topMargin: tuxoff.height*0.30 } MouseArea { id: off_area visible: false anchors.fill: off onClicked: { tuxoff.visible= false tuxon.visible= true } } } } Image { id: tuxon source: activity.url + "lightson.svg" height: parent.height*0.2 width: parent.width*0.15 anchors { bottom: parent.bottom right: parent.right bottomMargin: parent.height* 0.3 rightMargin: parent.width*0.02 } Image { id: on source: activity.url + "on.svg" sourceSize.height: parent.height*0.20 sourceSize.width: parent.height*0.20 anchors { right: tuxon.right top: tuxon.top rightMargin: tuxon.width*0.20 topMargin: tuxon.height*0.30 } MouseArea { anchors.fill: on onClicked: { tuxoff.visible= true tuxon.visible= false } } } visible: false } + //Level 2 wind turbines + + Image { + id: cloud_quiet + opacity: 1 + source: activity.url + "wind/cloud_quiet.svg" + sourceSize.width: parent.width * 0.20 + sourceSize.height: parent.height*0.10 + anchors { + right: parent.right + top: parent.top + rightMargin: 0.05*parent.width + } + } + + Image { + id: cloud_fury + opacity: 0 + source: activity.url + "wind/cloud_fury.svg" + sourceSize.width: parent.width * 0.20 + sourceSize.height: parent.height*0.10 + anchors { + right: parent.right + top: parent.top + rightMargin: 0.05*parent.width + } + } + + Image { + id: wind_transformer + source: activity.url + "transformer.svg" + sourceSize.width: parent.width*0.035 + height: parent.height*0.06 + anchors { + top: parent.top + right: parent.right + topMargin: parent.height*0.2 + rightMargin: parent.width*0.18 + } + } + + Image { + id: wind_poweroff + source: activity.url + "wind/windpoweroff.svg" + sourceSize.width: parent.width + sourceSize.height: parent.height + anchors.fill: parent + visible: true + } + + Image { + id: wind_poweron + source: activity.url + "wind/windpoweron.svg" + sourceSize.width: parent.width + sourceSize.height: parent.height + anchors.fill: parent + visible: false + } + + Image { + id:turbine1 + source: activity.url + "wind/turbine1.svg" + opacity: 0 + sourceSize.width: parent.width*0.15 + height: parent.height*0.15 + anchors { + top: parent.top + right: parent.right + topMargin: parent.height*0.13 + rightMargin: parent.width*0.03 + } + } + + Image { + id:turbine2 + source: activity.url + "wind/turbine2.svg" + opacity: 0 + sourceSize.width: parent.width*0.15 + height: parent.height*0.15 + anchors { + top: parent.top + right: parent.right + topMargin: parent.height*0.13 + rightMargin: parent.width*0.03 + } + } + + Image { + id:turbine3 + source: activity.url + "wind/turbine3.svg" + opacity: 0 + sourceSize.width: parent.width*0.15 + height: parent.height*0.15 + anchors { + top: parent.top + right: parent.right + topMargin: parent.height*0.13 + rightMargin: parent.width*0.03 + } + } + + Image { + id:turbine4 + source: activity.url + "wind/turbine4.svg" + opacity: 0 + sourceSize.width: parent.width*0.15 + height: parent.height*0.15 + anchors { + top: parent.top + right: parent.right + topMargin: parent.height*0.13 + rightMargin: parent.width*0.03 + } + } + + SequentialAnimation { + id: wind_anim + running: false + loops: Animation.Infinite + + PropertyAnimation { + target:turbine1 + property: "opacity" + to: 1 + } + + PropertyAnimation { + target:turbine2 + property: "opacity" + to: 1 + } + + PropertyAnimation { + target:turbine3 + property: "opacity" + to: 1 + } + + PropertyAnimation { + target:turbine4 + property: "opacity" + to: 1 + } + + } + + // solar panels + + Image { + id: solar_transformer + source: activity.url + "transformer.svg" + sourceSize.width: parent.width*0.05 + height: parent.height*0.08 + anchors { + top: parent.top + right: parent.right + topMargin: parent.height*0.38 + rightMargin: parent.width*0.11 + } + MouseArea { + id: solar_area + anchors.fill: solar_transformer + onClicked: { + solarpoweron.visible= true + solarpoweroff.visible= false + } + } + } + + Image { + id: solarpoweron + source: activity.url + "solar/solarpoweron.svg" + sourceSize.width: parent.width + anchors.fill: parent + visible: false + } + + Image { + id: solarpoweroff + source: activity.url + "solar/solarpoweroff.svg" + sourceSize.width: parent.width + anchors.fill: parent + visible: true + } + + Image { + id: solarpaneloff + source: activity.url + "solar/solarpaneloff.svg" + sourceSize.width: parent.width*0.07 + height: parent.height*0.09 + anchors { + top: parent.top + right: parent.right + topMargin: parent.height*0.31 + rightMargin: parent.width*0.14 + } + visible: true + MouseArea { + anchors.fill: solarpaneloff + onClicked: { + solarpanelon.visible= true + } + } + } + + Image { + id: solarpanelon + source: activity.url + "solar/solarpanelon.svg" + sourceSize.width: parent.width*0.07 + height: parent.height*0.09 + anchors { + top: parent.top + right: parent.right + topMargin: parent.height*0.31 + rightMargin: parent.width*0.14 + } + MouseArea { + anchors.fill: solarpanelon + onClicked: { + solarpanelon.visible= false + } + } + visible: false + } + + //transitions,animations and state changes. states: [ State { name:"up" AnchorChanges { target: sun anchors { left: parent.left top: parent.top } } PropertyChanges { target: sun anchors { leftMargin: parent.width*0.05 topMargin: parent.height*0.05 } } AnchorChanges { target:vapor anchors { left: parent.left top: parent.top } } PropertyChanges { target: vapor opacity: 1 anchors { leftMargin: parent.width*0.05 topMargin: parent.height*0.15 } } AnchorChanges { target: cloud anchors { top: parent.top left: parent.left } } PropertyChanges { target: cloud opacity: 1 anchors { leftMargin: parent.width*0.35 } } } , State { name: "down" AnchorChanges { target: sun anchors { left:parent.left top:parent.top } } PropertyChanges { target: sun anchors { leftMargin: parent.width*0.05 topMargin: parent.height*0.30 } } PropertyChanges{ target: cloud opacity:0 } PropertyChanges { target: vapor opacity: 0 } } ] transitions: [ Transition { to: "up" SequentialAnimation { AnchorAnimation { targets: sun duration: 3000 } NumberAnimation { target: vapor property: "opacity" duration:100 } AnchorAnimation { targets: vapor loops: 5 duration: 1000 } NumberAnimation { target: cloud property: "opacity" duration: 50 } AnchorAnimation { targets: cloud duration: 3000 } } } , Transition { from: "up" to: "down" SequentialAnimation { NumberAnimation { target: cloud property: "opacity" duration: 100 } NumberAnimation { target: vapor property: "opacity" duration: 100 } AnchorAnimation { targets: sun duration: 3000 } } } ] //functions function cloudcheck() { if( cloud2.opacity == 1 ) { rain.visible= true river.visible= true } } onStart: { Activity.start(items) } onStop: { Activity.stop() } DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar content: BarEnumContent { value: help | home | level } onHelpClicked: { displayDialog(dialogHelp) } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() } Bonus { id: bonus Component.onCompleted: win.connect(Activity.nextLevel) } } } diff --git a/src/activities/hydroelectric/resource/dam.svg b/src/activities/hydroelectric/resource/hydroelectric/dam.svg similarity index 100% rename from src/activities/hydroelectric/resource/dam.svg rename to src/activities/hydroelectric/resource/hydroelectric/dam.svg diff --git a/src/activities/hydroelectric/resource/damwire.svg b/src/activities/hydroelectric/resource/hydroelectric/damwire.svg similarity index 100% rename from src/activities/hydroelectric/resource/damwire.svg rename to src/activities/hydroelectric/resource/hydroelectric/damwire.svg diff --git a/src/activities/hydroelectric/resource/reservoir1.svg b/src/activities/hydroelectric/resource/hydroelectric/reservoir1.svg similarity index 100% rename from src/activities/hydroelectric/resource/reservoir1.svg rename to src/activities/hydroelectric/resource/hydroelectric/reservoir1.svg diff --git a/src/activities/hydroelectric/resource/reservoir2.svg b/src/activities/hydroelectric/resource/hydroelectric/reservoir2.svg similarity index 100% rename from src/activities/hydroelectric/resource/reservoir2.svg rename to src/activities/hydroelectric/resource/hydroelectric/reservoir2.svg diff --git a/src/activities/hydroelectric/resource/reservoir3.svg b/src/activities/hydroelectric/resource/hydroelectric/reservoir3.svg similarity index 100% rename from src/activities/hydroelectric/resource/reservoir3.svg rename to src/activities/hydroelectric/resource/hydroelectric/reservoir3.svg diff --git a/src/activities/hydroelectric/resource/reservoir4.svg b/src/activities/hydroelectric/resource/hydroelectric/reservoir4.svg similarity index 100% rename from src/activities/hydroelectric/resource/reservoir4.svg rename to src/activities/hydroelectric/resource/hydroelectric/reservoir4.svg diff --git a/src/activities/hydroelectric/resource/reservoir5.svg b/src/activities/hydroelectric/resource/hydroelectric/reservoir5.svg similarity index 100% rename from src/activities/hydroelectric/resource/reservoir5.svg rename to src/activities/hydroelectric/resource/hydroelectric/reservoir5.svg diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/hydroelectric/stepdown.svg similarity index 100% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/hydroelectric/stepdown.svg diff --git a/src/activities/hydroelectric/resource/stepupwire.svg b/src/activities/hydroelectric/resource/hydroelectric/stepupwire.svg similarity index 100% copy from src/activities/hydroelectric/resource/stepupwire.svg copy to src/activities/hydroelectric/resource/hydroelectric/stepupwire.svg diff --git a/src/activities/hydroelectric/resource/lightson.svg b/src/activities/hydroelectric/resource/lightson.svg index 63c848338..5c660e6d4 100644 --- a/src/activities/hydroelectric/resource/lightson.svg +++ b/src/activities/hydroelectric/resource/lightson.svg @@ -1,399 +1,399 @@ + sodipodi:docname="lightson.svg"> + inkscape:window-y="-3" + inkscape:window-maximized="1" /> image/svg+xml - + + transform="translate(-159.60232,274.27445)"> diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/solar/solarpaneloff.svg similarity index 82% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/solar/solarpaneloff.svg index 2ca740e37..35de62853 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/solar/solarpaneloff.svg @@ -1,2241 +1,2151 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + transform="translate(-632.86423,-167.95908)"> - - - - + transform="translate(-632.86423,-167.95908)"> + + + + + + + + + + + + + + + + + transform="translate(-632.86423,-167.95908)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + transform="translate(-632.86423,-167.95908)"> + transform="translate(-632.86423,-167.95908)" /> + transform="translate(-632.86423,-167.95908)" /> diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/solar/solarpanelon.svg similarity index 76% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/solar/solarpanelon.svg index 2ca740e37..939546b03 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/solar/solarpanelon.svg @@ -1,2241 +1,2311 @@ - - - - - - - - - - - - - - - - - - - - - image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + transform="translate(-632.86423,-167.95908)"> - - - - + transform="translate(-632.86423,-167.95908)"> + + + + + + + + + + + + + + + + + transform="translate(-632.86423,-167.95908)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + transform="translate(-632.86423,-167.95908)"> + transform="translate(-632.86423,-167.95908)" /> + transform="translate(-632.86423,-167.95908)" /> diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/solar/solarpoweroff.svg similarity index 96% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/solar/solarpoweroff.svg index 2ca740e37..133d6c251 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/solar/solarpoweroff.svg @@ -1,2241 +1,2223 @@ + inkscape:snap-grids="true" /> image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + inkscape:label="BACKGROUND"> - - - - + style="display:inline"> + + + + + style="display:inline" /> + style="display:inline"> + style="display:inline" /> + style="display:inline" /> diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/solar/solarpoweron.svg similarity index 96% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/solar/solarpoweron.svg index 2ca740e37..04be43cd8 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/solar/solarpoweron.svg @@ -1,2241 +1,2243 @@ + inkscape:snap-grids="true" /> image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + inkscape:label="BACKGROUND"> - - + style="display:inline"> + sodipodi:nodetypes="cccccc" /> + sodipodi:nodetypes="csc" /> + style="display:inline" /> + style="display:inline"> + style="display:inline"> + + + 400 + + + style="display:inline" /> diff --git a/src/activities/hydroelectric/resource/wind/cloud_fury.svg b/src/activities/hydroelectric/resource/wind/cloud_fury.svg new file mode 100644 index 000000000..886c53727 --- /dev/null +++ b/src/activities/hydroelectric/resource/wind/cloud_fury.svg @@ -0,0 +1,176 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/activities/hydroelectric/resource/wind/cloud_quiet.svg b/src/activities/hydroelectric/resource/wind/cloud_quiet.svg new file mode 100644 index 000000000..8da39fa8b --- /dev/null +++ b/src/activities/hydroelectric/resource/wind/cloud_quiet.svg @@ -0,0 +1,80 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/wind/turbine1.svg similarity index 82% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/wind/turbine1.svg index 2ca740e37..59e42692a 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/wind/turbine1.svg @@ -1,2241 +1,2425 @@ + + + + + + image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + transform="translate(-660.9427,-73)"> - - - - - + transform="translate(-660.9427,-73)" /> + transform="translate(-660.9427,-73)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + transform="translate(-660.9427,-73)"> + transform="translate(-660.9427,-73)" /> + transform="translate(-660.9427,-73)" /> diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/wind/turbine2.svg similarity index 86% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/wind/turbine2.svg index 2ca740e37..5f2330710 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/wind/turbine2.svg @@ -1,2241 +1,2344 @@ + + + + + + + + + + + + image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + transform="translate(-660.9427,-73)"> - - - - - + transform="translate(-660.9427,-73)" /> + transform="translate(-660.9427,-73)"> + + + transform="translate(-660.9427,-73)"> + transform="translate(-660.9427,-73)" /> + transform="translate(-660.9427,-73)" /> diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/wind/turbine3.svg similarity index 81% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/wind/turbine3.svg index 2ca740e37..d318e4413 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/wind/turbine3.svg @@ -1,2241 +1,2479 @@ + + + + + + + + + + + + image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + transform="translate(-660.9427,-73)"> - - - - - + transform="translate(-660.9427,-73)" /> + transform="translate(-660.9427,-73)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + transform="translate(-660.9427,-73)"> + transform="translate(-660.9427,-73)" /> + transform="translate(-660.9427,-73)" /> diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/wind/turbine4.svg similarity index 80% copy from src/activities/hydroelectric/resource/stepdown.svg copy to src/activities/hydroelectric/resource/wind/turbine4.svg index 2ca740e37..32bdf9f14 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/wind/turbine4.svg @@ -1,2241 +1,2479 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + transform="translate(-660.9427,-73)"> - - - - - + transform="translate(-660.9427,-73)" /> + transform="translate(-660.9427,-73)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + transform="translate(-660.9427,-73)"> + transform="translate(-660.9427,-73)" /> + transform="translate(-660.9427,-73)" /> diff --git a/src/activities/hydroelectric/resource/stepupwire.svg b/src/activities/hydroelectric/resource/wind/windpoweroff.svg similarity index 85% rename from src/activities/hydroelectric/resource/stepupwire.svg rename to src/activities/hydroelectric/resource/wind/windpoweroff.svg index 8c1be7c33..81bedfc7d 100644 --- a/src/activities/hydroelectric/resource/stepupwire.svg +++ b/src/activities/hydroelectric/resource/wind/windpoweroff.svg @@ -1,1564 +1,1520 @@ image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle - - - - - - - - - - - - - - - + style="display:inline;enable-background:new" + id="WIND_FARM_BG"> + + + + + + + id="path4887" + d="m 639.15716,121.75593 c -2.69242,12.87679 -6.15112,17.02538 -13.76013,22.87847 1.93151,4.21422 -28.2806,57.01447 -46.63809,63.24766 3.26501,4.66352 8.01836,12.75381 13.08559,14.38193" + style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + id="path5810" + d="m 755.15776,145.02854 c -4.1383,19.49334 -39.17892,-0.67831 -38.9871,-7.94642 -17.38278,1.98661 -24.33589,-11.91962 -36.50384,-17.87943 -13.59012,5.95981 -22.46761,8.44307 -25.08088,2.23493" + style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;enable-background:new" /> + style="display:inline"> + + + + 0 + diff --git a/src/activities/hydroelectric/resource/stepdown.svg b/src/activities/hydroelectric/resource/wind/windpoweron.svg similarity index 91% rename from src/activities/hydroelectric/resource/stepdown.svg rename to src/activities/hydroelectric/resource/wind/windpoweron.svg index 2ca740e37..3ae9bee29 100644 --- a/src/activities/hydroelectric/resource/stepdown.svg +++ b/src/activities/hydroelectric/resource/wind/windpoweron.svg @@ -1,2241 +1,2300 @@ + inkscape:snap-grids="true" /> image/svg+xml - + 28/10/2008 Cabaraux Stéphane Cabaraux Stéphane Gnurps gcompris watercycle + inkscape:label="BACKGROUND"> - - + style="display:inline"> + + + + + + + + + + + sodipodi:nodetypes="cccc" + inkscape:label="#TRANSFORMER_WINDFARM_TO_USERS" /> + sodipodi:nodetypes="cccc" /> + style="display:inline" /> + style="display:inline"> + style="display:inline"> + + + + 400 + + style="display:inline" /> diff --git a/src/activities/intro_gravity/IntroGravity.qml b/src/activities/intro_gravity/IntroGravity.qml index b68bb448d..2fd344178 100644 --- a/src/activities/intro_gravity/IntroGravity.qml +++ b/src/activities/intro_gravity/IntroGravity.qml @@ -1,243 +1,244 @@ /* GCompris - intro_gravity.qml * * Copyright (C) 2015 Siddhesh suthar * * Authors: * Bruno Coudoin and Matilda Bernard (GTK+ version) * Siddhesh suthar (Qt Quick port) * * 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 import "../../core" import "intro_gravity.js" as Activity ActivityBase { id: activity onStart: focus = true onStop: {} property int oldWidth: width onWidthChanged: { // Reposition planets and asteroids, same for height Activity.repositionObjectsOnWidthChanged(width / oldWidth) oldWidth = width } property int oldHeight: height onHeightChanged: { // Reposition planets and asteroids, same for height Activity.repositionObjectsOnHeightChanged(height / oldHeight) oldHeight = height } pageComponent: Image { id: background anchors.fill: parent source: Activity.url+"background.svg" sourceSize.width: parent.width fillMode: Image.PreserveAspectCrop signal start signal stop Component.onCompleted: { activity.start.connect(start) activity.stop.connect(stop) } // Add here the QML items you need to access in javascript QtObject { id: items property Item main: activity.main property alias background: background property alias bar: bar property alias bonus: bonus property alias planetLeft: planetLeft property alias planetRight: planetRight property alias scaleLeft: planetLeft.value property alias scaleRight: planetRight.value property alias spaceship: spaceship property alias shuttle: shuttle property alias shuttleMotion: shuttleMotion property alias timer: timer property alias arrow: arrow property alias asteroidCreation: asteroidCreation property GCAudio audioEffects: activity.audioEffects property double distLeft: Math.abs(spaceshipX) property double distRight: Math.abs(background.width - spaceshipX) property double forceLeft: (Math.pow(scaleLeft, 2) / Math.pow(distLeft, 2)) * Math.pow(10, 6) property double forceRight: (Math.pow(scaleRight, 2) / Math.pow(distRight, 2)) * Math.pow(10, 6) // the center value for the spaceship property double spaceshipX property double spaceshipY: parent.height / 2 property alias trigger: trigger } onStart: Activity.start(items,message) onStop: Activity.stop() DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar content: BarEnumContent { value: help | home | level | reload } onHelpClicked: { displayDialog(dialogHelp) } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() onReloadClicked: Activity.initLevel() } Bonus { id: bonus Component.onCompleted: win.connect(Activity.nextLevel) } Timer { id: trigger onTriggered: { items.timer.start() items.asteroidCreation.start() items.shuttleMotion.restart() } } IntroMessage { id: message intro: [ "", qsTr("Gravity is universal and Newton's law of universal gravitation extends gravity" +" beyond earth. This force of gravitational attraction is directly dependent" +" upon the masses of both objects and inversely proportional to" +" the square of the distance that separates their centers."), qsTr("Since the gravitational force is directly proportional to the mass of both interacting " +"objects, more massive objects will attract each other with a greater gravitational " +"force. So as the mass of either object increases, the force of gravitational " +"attraction between them also increases"), qsTr("But this force is inversely proportional to the square of the separation distance " +"between the two interacting objects, more separation distance will " +"result in weaker gravitational forces."), qsTr("Your goal is to let Tux's spaceship move by changing the mass " +"of its surrounding planets. Don't get too close to the planets " +"or you will crash on them. " +"The arrow indicates the direction of the force on your ship."), qsTr("Avoid the asteroid and join the space " - +"shuttle to win.") + +"shuttle to win."), + "" ] z: 20 anchors { top: parent.top topMargin: 10 right: parent.right rightMargin: 5 left: parent.left leftMargin: 5 } } Planet { id: planetLeft x: 0 width: parent.width * 0.5 height: parent.height planetSource: Activity.url + "saturn.svg" planetWidth: 240 * ApplicationInfo.ratio isLeft: true } Planet { id: planetRight x: parent.width / 2 width: parent.width * 0.5 height: parent.height planetSource: Activity.url + "neptune.svg" planetWidth: 184 * ApplicationInfo.ratio isLeft: false } Image { id: spaceship source: Activity.url + "tux_spaceship.svg" sourceSize.width: 120 * ApplicationInfo.ratio x: items.spaceshipX - width / 2 y: items.spaceshipY - height / 2 } // line to show force magnitude and direction Image { id: arrow visible: !message.displayed && width > 6 && timer.running x: items.forceLeft < items.forceRight ? items.spaceshipX : items.spaceshipX - width y: spaceship.y - 80 z: 11 sourceSize.width: 120 * 10 * ApplicationInfo.ratio width: Math.min(background.width / 4, Math.abs(items.forceLeft - items.forceRight) * 6) height: 40 * ApplicationInfo.ratio source: Activity.url +"arrow.svg" rotation: items.forceLeft > items.forceRight ? 0 : 180 Behavior on rotation { NumberAnimation{ duration: 100 } } Behavior on width { NumberAnimation{ duration: 100 } } } Image { id: shuttle source: Activity.url + "space_shuttle.svg" sourceSize.width: 80 * ApplicationInfo.ratio z: 10 NumberAnimation { id: shuttleMotion target: shuttle property: "y" to: 0 - shuttle.height duration: 40000 / (Activity.currentLevel+1) } } Timer { id: timer interval: 16 running: false repeat: true onTriggered: { Activity.movespaceship() Activity.handleCollisionWithAsteroid() } } Timer { id: asteroidCreation running: false repeat: true interval: 10200 - (bar.level * 200) onTriggered: Activity.createAsteroid() } } }