diff --git a/src/activities/hydroelectric/ActivityInfo.qml b/src/activities/hydroelectric/ActivityInfo.qml index 75b9c5a9c..dbca10b77 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 <atomsagar@gmail.com>" 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: "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" + prerequisite: "" credit: qsTr("Drawing by Stephane Cabaraux. ") section: "experiment" } diff --git a/src/activities/hydroelectric/Hydro.qml b/src/activities/hydroelectric/Hydro.qml index 2a3d4f89d..f18e459b0 100644 --- a/src/activities/hydroelectric/Hydro.qml +++ b/src/activities/hydroelectric/Hydro.qml @@ -1,716 +1,710 @@ /* GCompris - hydro.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 Item { id: hydro state: "down" - property int click: 0 + property bool check: false property bool scenery: false IntroMessage { id: message - opacity: Activity.currentLevel == 0 ? true : start() + opacity: Activity.currentLevel == 0 ? 1 : start() z: 20 anchors { top: parent.top topMargin: 10 right: parent.right rightMargin: 5 left: parent.left leftMargin: 5 } onIntroDone: { - anim.running= true - sun_area.visible= true + anim.running = true + sun_area.visible = true } 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("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. ") ] } function start() { message.opacity = 0 - anim.running= true - sun_area.visible= true + anim.running = true + sun_area.visible = true } 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 - Activity.tuxreached= true + tuxoff.visible = true + Activity.tuxreached = true Activity.showtuxmeter() } } } } - 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: { - if(click == 0){ - hydro.state= "up" - click = 1 - Activity.panel( true ) + if(check == false){ + hydro.state = "up" + check = true + Activity.panel() cloudarea.start() } else { if(Activity.currentLevel == 2) { - hydro.state= "rise" - click = 1 - Activity.panel( true ) + hydro.state = "rise" + Activity.panel() sunset.start() } - } } } } 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: 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 { id: cloud_area visible: false anchors.fill: cloud onClicked: { - rain.visible= true - river.visible= true - anim2.running= true + rain.visible = true + river.visible = true + anim2.running = true } } Image { id: rain source: activity.url + "rain.svg" height:cloud.height*2 width: cloud.width anchors { top: cloud.bottom } visible: false } } 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.293 } visible: false } Image { id: reservoir1 source: activity.url + "hydroelectric/reservoir1.svg" width: parent.width*0.06 height: parent.height*0.15 anchors { top: parent.top left: parent.left topMargin: parent.height*0.2925 leftMargin: parent.width*0.3225 } opacity: 0 } Image { id: reservoir2 source: activity.url + "hydroelectric/reservoir2.svg" width: parent.width*0.12 height: parent.height*0.155 anchors { top: parent.top left: parent.left topMargin: parent.height*0.2925 leftMargin: parent.width*0.285 } opacity: 0 } Image { id: reservoir3 source: activity.url + "hydroelectric/reservoir3.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 } opacity: 0 } SequentialAnimation { id: anim2 running: false PropertyAnimation{ target: reservoir1 property: "opacity" to: 1 } PauseAnimation { duration: 1000 } PropertyAnimation{ target: reservoir2 property: "opacity" to: 1 } PauseAnimation { duration: 1000 } PropertyAnimation{ target: reservoir3 property: "opacity" to: 1 } onRunningChanged: { if(!anim2.running) { - hydro.state= "down" - rain.visible= false - cloud.opacity= 0 - dam_area.visible= true + hydro.state = "down" + rain.visible = false + cloud.opacity = 0 + dam_area.visible = true if( Activity.currentLevel == 2) { panel_timer.start() } } } } Image{ source: activity.url + "left.svg" width: dam.width/2 height: dam.height*0.5 anchors { left:dam.left leftMargin: parent.width*0.05 top: dam.top } Rectangle{ - width: dam_voltage.width*1.5 + width: dam_voltage.width*1.1 height: dam_voltage.height*1.1 border.color: "black" radius :5 color:"yellow" anchors { left: parent.right } - Text { + GCText { + fontSize: smallSize * 0.5 id: dam_voltage anchors.centerIn: parent - text: qsTr("0 W") + text: "0 W" } } } Image { id: dam 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:{ - anim3.running= true - damwire.visible= true - dam_voltage.text= qsTr("900 W") + anim3.running = true + damwire.visible = true + dam_voltage.text = "900 W" } } } SequentialAnimation { id: anim3 running: false PropertyAnimation{ target: reservoir3 property: "opacity" to: 0 } PauseAnimation { duration: 1000 } PropertyAnimation{ target: reservoir2 property: "opacity" to: 0 } PauseAnimation { duration: 1000 } PropertyAnimation{ target: reservoir1 property: "opacity" to: 0 } onRunningChanged: { if(!anim3.running) { stepup1_area.visible= true dam_area.visible= false } } } Image { id: damwire 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: { if(stepupwire1.visible == true){ - stepupwire1.visible= false + stepupwire1.visible = false Activity.add(-900) Activity.volt(-900) Activity.update() Activity.verify() } else { - stepupwire1.visible= true + stepupwire1.visible = true Activity.add(900) Activity.volt(900) Activity.update() } } } } Image { id: stepupwire1 source: activity.url + "hydroelectric/stepupwire.svg" sourceSize.width: parent.width sourceSize.height: parent.height anchors.fill: parent 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: hydro.width*0.05 topMargin: hydro.height*0.05 } } AnchorChanges { target:vapor anchors { left: parent.left top: parent.top } } PropertyChanges { target: vapor opacity: 1 anchors { leftMargin: hydro.width*0.05 topMargin: hydro.height*0.15 } } AnchorChanges { target: cloud anchors { top: parent.top left: parent.left } } PropertyChanges { target: cloud opacity: 1 anchors { leftMargin: hydro.width*0.35 } } } , State { name: "down" AnchorChanges { target: sun anchors { left: parent.left top: parent.top } } PropertyChanges { target: sun anchors { leftMargin: hydro.width*0.05 topMargin: hydro.height*0.30 } } AnchorChanges { target: vapor anchors { top: mask.bottom left: parent.left } } PropertyChanges { target: vapor opacity: 0 anchors { leftMargin: hydro.width*0.05 } } }, State { name: "rise" AnchorChanges { target: sun anchors { left: parent.left top: parent.top } } + PropertyChanges { target: sun anchors { leftMargin: hydro.width*0.05 topMargin: hydro.height*0.05 } } }, State { name: "set" AnchorChanges { target: sun anchors { left: parent.left top: parent.top } } PropertyChanges { target: sun anchors { leftMargin: hydro.width*0.05 topMargin: hydro.height*0.30 } } } ] transitions: [ Transition { to: "up" SequentialAnimation { id: rainform 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 { id: down NumberAnimation { target: vapor property: "opacity" duration: 100 } AnchorAnimation { targets: vapor duration: 100 } AnchorAnimation { - id: check targets: sun duration: Activity.currentLevel != 2 ? 3000 : 5000 } } }, Transition { to: "rise" AnchorAnimation { targets: sun duration: 3000 } }, Transition { from: "rise" to: "set" AnchorAnimation { targets: sun - duration: 3000 + duration: 5000 } } ] Timer { id: panel_timer interval: 5200 running: false repeat: false onTriggered: { Activity.paneloff() - Activity.flag = 0 - Activity.panel_activate= false + Activity.panel_activate = false panel_timer.stop() } } Timer { id: cloudarea interval: 11150 running: false repeat: false onTriggered: { - cloud_area.visible= true + cloud_area.visible = true cloudarea.stop() } } Timer { id: sunset - interval: 13000 + interval: 5000 running: false repeat: false onTriggered: { hydro.state= "set" - Activity.paneloff() - Activity.flag = 0 - Activity.panel_activate= false + panel_timer.start() sunset.stop() } } Timer { id: scene - interval: 20000 + interval: 40000 running: Activity.currentLevel == 2 ? true : false repeat: true onTriggered: { if(scenery == false ) { console.log("night") Activity.sceneload(true) sun_area.visible= false - hydro.state= "down" - scenery= true + hydro.state = "down" + scenery = true Activity.paneloff() - Activity.flag = 0 - Activity.panel_activate= false - sun.visible= false + Activity.panel_activate = false + sun.visible = false } else { if(river.visible == false){ - click = 0 + check = false console.log("day") Activity.sceneload(false) - sun_area.visible= true - scenery= false - sun.visible= true + sun_area.visible = true + scenery = false + sun.visible = true } else { console.log("day") Activity.sceneload(false) - sun_area.visible= true - scenery= false - sun.visible= true + sun_area.visible = true + scenery = false + sun.visible = true } } } } } diff --git a/src/activities/hydroelectric/Hydroelectric.qml b/src/activities/hydroelectric/Hydroelectric.qml index e314cdc33..2f9b8112b 100755 --- a/src/activities/hydroelectric/Hydroelectric.qml +++ b/src/activities/hydroelectric/Hydroelectric.qml @@ -1,804 +1,863 @@ /* 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 property bool transformer: false 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 daysky: daysky - property alias moon: moon } Image { id: daysky anchors.top: parent.top sourceSize.width: parent.width source: activity.url + "sky.svg" height: (background.height - landscape.paintedHeight) / 2 + landscape.paintedHeight * 0.3 visible: true } 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 visible: true } - - - Image { - id: landscape - anchors.fill: parent - sourceSize.width: parent.width - sourceSize.height: parent.height - source: activity.url + "landscape.svg" - } - Image { id: moon source: activity.url + "moon.svg" sourceSize.width: parent.width*0.05 anchors { left: parent.left top: parent.top - leftMargin: parent.width*0.05 + leftMargin: parent.width*0.1 topMargin: parent.height*0.05 } - visible: false + opacity: 0 + NumberAnimation on opacity { + id: moon_rise + running: false + from: 0 + to: 1 + duration: 10000 + } + NumberAnimation on opacity { + id: moon_set + running: false + from: 1 + to: 0 + duration: 10000 + } + } + + Timer { + id: moon_anim + running: false + repeat: true + interval :30000 + onTriggered: if(Activity.scene == false) { + moon_rise.running = true + anim_pause.start() + moon_anim.stop() + } + else { + moon_set.running = true + anim_pause.start() + moon_anim.stop() + } + } + + Timer { + id: anim_pause + running: false + interval: 10000 + repeat: false + onTriggered: { + anim_pause.stop() + moon_anim.start() + } + } + + Image { + id: landscape + anchors.fill: parent + sourceSize.width: parent.width + sourceSize.height: parent.height + source: activity.url + "landscape.svg" } Rectangle { id: check visible: false width: 400 * ApplicationInfo.ratio height: 200 * ApplicationInfo.ratio anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter z: 3 border.width: 2 radius: 5 color: "#00d635" - Text { + GCText { id: warning anchors.fill: parent horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter text: qsTr( "It is not possible to consume more electricity "+ "than what is produced. This is a key limitation in the "+ "distribution of electricity, with minor exceptions, "+ "electrical energy cannot be stored, and therefore it "+ "must be generated as it is needed. A sophisticated "+ "system of control is therefore required to ensure electric "+ "generation very closely matches the demand. If supply and demand "+ "are not in balance, generation plants and transmission equipment "+ "can shut down which, in the worst cases, can lead to a major "+ "regional blackout.") fontSizeMode: Text.Fit minimumPointSize: 10 wrapMode: Text.WordWrap + fontSize: smallSize } Behavior on opacity { NumberAnimation { duration: 200 } } MouseArea { anchors.fill: parent - onClicked: check.visible= false + onClicked: check.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 { anchors.fill: stepdown onClicked: { power() if( Activity.power > 0 ) { - stepdownwire.visible= true + stepdownwire.visible = true } else { - stepdownwire.visible= false + stepdownwire.visible = false } } } } Image{ source: activity.url + "right.svg" sourceSize.width: stepdown.width/2 sourceSize.height: stepdown.height/2 anchors { right:stepdown.left bottom:stepdown.bottom bottomMargin: parent.height*0.03 } Rectangle{ - width: pow.width*1.5 + width: pow.width*1.1 height: pow.height*1.1 border.color: "black" radius :5 color:"yellow" anchors { top: parent.top right: parent.left } - Text { + GCText { id: pow anchors.centerIn: parent + fontSize: smallSize * 0.5 } } } Image{ source: activity.url + "down.svg" sourceSize.width: stepdown.width/2 sourceSize.height: stepdown.height/2 anchors { left: stepdown.left top: stepdown.top - leftMargin: parent.width*0.04 + topMargin: stepdown.height*0.8 + leftMargin: parent.width*0.05 } Rectangle{ - width: stepdown_info.width*1.5 + width: stepdown_info.width*1.1 height: stepdown_info.height*1.1 border.color: "black" radius :5 color:"red" anchors { - bottom: parent.top + top: parent.bottom + left: parent.right } - Text { + GCText { id: stepdown_info anchors.centerIn: parent + fontSize: smallSize * 0.5 } } } - Image { id: stepdownwire source: activity.url + "hydroelectric/stepdown.svg" sourceSize.width: parent.width anchors.fill: parent visible: false } Image { id: residentsmalloff visible: false source: activity.url + "off.svg" sourceSize.height: parent.height*0.03 sourceSize.width: parent.height*0.03 anchors { left: parent.left top: parent.top leftMargin: parent.width*0.55 topMargin: parent.height*0.65 } MouseArea { id: small_area visible: false anchors.fill: residentsmalloff onClicked: { if( Activity.power >= 300 && stepdownwire.visible == true) { Activity.add(-300) - resident_smalllights.visible= true - residentsmalloff.visible= false - residentsmallon.visible= true + resident_smalllights.visible = true + residentsmalloff.visible = false + residentsmallon.visible = true Activity.consume(300) - stepdown_info.text = (Activity.count.toString()).concat(" W") - small_consume.text= qsTr("300 W") + stepdown_info.text = "%1 W".arg(Activity.count) + small_consume.text = "300 W" checkbonus() } else { if(stepdownwire.visible == true) { check.visible= true } } } } } Image { id: residentsmallon visible: false source: activity.url + "on.svg" sourceSize.height: parent.height*0.03 sourceSize.width: parent.height*0.03 anchors { left: parent.left top: parent.top leftMargin: parent.width*0.55 topMargin: parent.height*0.65 } MouseArea { anchors.fill: residentsmallon onClicked: { Activity.add(300) Activity.consume(-300) - resident_smalllights.visible= false - residentsmallon.visible= false - residentsmalloff.visible= true - small_consume.text= qsTr("0 W") - stepdown_info.text = (Activity.count.toString()).concat(" W") + resident_smalllights.visible = false + residentsmallon.visible = false + residentsmalloff.visible = true + small_consume.text= "0 W" + stepdown_info.text = "%1 W".arg(Activity.count) } } } Image { id: residentbigoff visible: false source: activity.url + "off.svg" sourceSize.height: parent.height*0.03 sourceSize.width: parent.height*0.03 anchors { left: parent.left top: parent.top leftMargin: parent.width*0.60 topMargin: parent.height*0.65 } MouseArea { id: big_area visible: false anchors.fill: residentbigoff onClicked: { if( Activity.power >= 600 && stepdownwire.visible == true) { Activity.add(-600) - resident_biglights.visible= true - residentbigoff.visible= false - residentbigon.visible= true + resident_biglights.visible = true + residentbigoff.visible = false + residentbigon.visible = true Activity.consume(600) - stepdown_info.text = (Activity.count.toString()).concat(" W") - big_consume.text= qsTr("600 W") + stepdown_info.text = "%1 W".arg(Activity.count) + big_consume.text = "600 W" checkbonus() } else { if(stepdownwire.visible == true) { - check.visible= true + check.visible = true } } } } } Image { id: residentbigon visible: false source: activity.url + "on.svg" sourceSize.height: parent.height*0.03 sourceSize.width: parent.height*0.03 anchors { left: parent.left top: parent.top leftMargin: parent.width*0.60 topMargin: parent.height*0.65 } MouseArea { anchors.fill: residentbigon onClicked: { Activity.add(600) Activity.consume(-600) - residentbigon.visible= false - residentbigoff.visible= true - resident_biglights.visible= false - stepdown_info.text = (Activity.count.toString()).concat(" W") - big_consume.text= qsTr("0 W") + residentbigon.visible = false + residentbigoff.visible = true + resident_biglights.visible = false + stepdown_info.text = "%1 W".arg(Activity.count) + big_consume.text = "0 W" } } } Image { id: resident_smalllights source: activity.url+ "resident_smallon.svg" sourceSize.width: parent.width sourceSize.height: parent.height anchors.fill: parent visible: false } Rectangle{ id: small_consume_rect - width: small_consume.width*1.5 + width: small_consume.width*1.1 height: small_consume.height*1.1 border.color: "black" - radius :5 + radius: 5 color:"yellow" anchors { top: residentsmallon.bottom left:residentsmallon.left } - Text { + GCText { id: small_consume anchors.centerIn: parent - text: qsTr("0 W") + text: "0 W" + fontSize: smallSize * 0.5 } visible: false } Image { id: resident_biglights source: activity.url+ "resident_bigon.svg" sourceSize.width: parent.width sourceSize.height: parent.height anchors.fill: parent visible: false } Rectangle{ id: big_consume_rect - width: big_consume.width*1.5 + width: big_consume.width*1.1 height: big_consume.height*1.1 border.color: "black" radius :5 color:"yellow" anchors { top: residentbigon.bottom left: small_consume_rect.right leftMargin: parent.width*0.05 } - Text { + GCText { id: big_consume anchors.centerIn: parent - text: qsTr("0 W") + text: "0 W" + fontSize: smallSize * 0.5 } 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: { if( Activity.power >= 100 && stepdownwire.visible == true) { Activity.add(-100) - tuxon.visible= true - tuxoff.visible= false + tuxon.visible = true + tuxoff.visible = false Activity.consume(100) - stepdown_info.text = (Activity.count.toString()).concat(" W") + stepdown_info.text = "%1 W".arg(Activity.count) checkbonus() - tux_consume.text= qsTr("100 W") + tux_consume.text = "100 W" } } } } } 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: { Activity.add(100) Activity.consume(-100) - tuxon.visible= false - tuxoff.visible= true - stepdown_info.text = (Activity.count.toString()).concat(" W") - tux_consume.text= qsTr("0 W") + tuxon.visible = false + tuxoff.visible = true + stepdown_info.text = "%1 W".arg(Activity.count) + tux_consume.text = "0 W" } } } visible: false } Rectangle{ id: tux_meter - width: tux_consume.width*1.5 + width: tux_consume.width*1.1 height: tux_consume.height*1.1 border.color: "black" radius :5 color:"yellow" anchors { top: tuxon.bottom left: tuxon.left } - Text { + GCText { id: tux_consume anchors.centerIn: parent - text: qsTr("0 W") + text: "0 W" + fontSize: smallSize * 0.5 } visible: false } function initiate() { unload() reload() power() } Loader { id: hydro anchors.fill: parent } Loader { id: wind anchors.fill: parent } Loader { id: solar anchors.fill: parent } function unload( ) { - pow.text = qsTr("0 W") - stepdown_info.text= qsTr("0 W") - stepdownwire.visible= false - off_area.visible= false - small_area.visible= false - big_area.visible= false - tuxon.visible= false - tuxoff.visible= false - residentsmalloff.visible= false + pow.text = "0 W" + stepdown_info.text = "0 W" + stepdownwire.visible = false + off_area.visible = false + small_area.visible = false + big_area.visible = false + tuxon.visible = false + tuxoff.visible = false + residentsmalloff.visible = false residentsmallon.visible= false - residentbigoff.visible= false - residentbigon.visible= false - resident_smalllights.visible= false - resident_biglights.visible= false - small_consume_rect.visible= false - big_consume_rect.visible= false - tux_meter.visible= false - small_consume.text= qsTr("0 W") - big_consume.text= qsTr("0 W") - tux_consume.text= qsTr("0 W") + residentbigoff.visible = false + residentbigon.visible = false + resident_smalllights.visible = false + resident_biglights.visible = false + small_consume_rect.visible = false + big_consume_rect.visible = false + tux_meter.visible = false + small_consume.text = "0 W" + big_consume.text= "0 W" + tux_consume.text = "0 W" wind.source = "" hydro.source ="" - solar.source= "" + solar.source = "" + moon_set.running = false + moon_rise.running = false + moon.opacity = 0 + moon_anim.running= false } function reload() { if(Activity.currentLevel == 0) { hydro.source = "Hydro.qml" } if(Activity.currentLevel == 1) { wind.source = "Wind.qml" hydro.source = "Hydro.qml" - residentsmalloff.visible= true - small_consume_rect.visible= true + residentsmalloff.visible = true + small_consume_rect.visible = true } if(Activity.currentLevel == 2) { solar.source = "Solar.qml" wind.source = "Wind.qml" hydro.source = "Hydro.qml" - residentsmalloff.visible= true - residentbigoff.visible= true - small_consume_rect.visible= true - big_consume_rect.visible= true + residentsmalloff.visible = true + residentbigoff.visible = true + small_consume_rect.visible = true + big_consume_rect.visible = true + daysky.source = activity.url + "sky.svg" + moon_anim.running = true } } function power() { if(Activity.currentLevel == 0 && Activity.power >= 0 ) { off_area.visible = true } if(Activity.currentLevel == 1 && Activity.power >= 0) { - off_area.visible= true - small_area.visible= true + off_area.visible = true + small_area.visible = true } if(Activity.currentLevel == 2 && Activity.count >= 0 ) { - off_area.visible= true - small_area.visible= true - big_area.visible= true + off_area.visible = true + small_area.visible = true + big_area.visible = true } } function tux() { Activity.add(100) Activity.consume(-100) - tuxon.visible= false - tuxoff.visible= true + tuxon.visible = false + tuxoff.visible = true Activity.update() - tux_consume.text= qsTr("0 W") - stepdown_info.text = (Activity.count.toString()).concat(" W") + tux_consume.text = "0 W" + stepdown_info.text = "%1 W".arg(Activity.count) } function small() { - resident_smalllights.visible= false - residentsmalloff.visible= true - residentsmallon.visible=false + resident_smalllights.visible = false + residentsmalloff.visible = true + residentsmallon.visible =false Activity.add(300) Activity.consume(-300) Activity.update() - small_consume.text= qsTr("0 W") - stepdown_info.text = (Activity.count.toString()).concat(" W") + small_consume.text= "0 W" + stepdown_info.text = "%1 W".arg(Activity.count) } function big() { - resident_biglights.visible= false - residentbigoff.visible= true - residentbigon.visible= false + resident_biglights.visible = false + residentbigoff.visible = true + residentbigon.visible = false Activity.add(600) Activity.consume(-600) Activity.update() - big_consume.text= qsTr("0 W") - stepdown_info.text = (Activity.count.toString()).concat(" W") + big_consume.text= "0 W" + stepdown_info.text = "%1 W".arg(Activity.count) } function reset() { if(Activity.currentLevel == 0) { - if(Activity.voltage == 0 && tuxon.visible != true) { - stepdownwire.visible= false + if(Activity.voltage == 0) { + stepdownwire.visible = false } } if(Activity.currentLevel == 1) { if(Activity.voltage == 0 && residentsmallon.visible != true && tuxon.visible != true) { - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible == true && tuxon.visible == true) { tux() small() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible != true && tuxon.visible == true) { tux() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible == true && tuxon.visible != true) { small() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 100 && residentsmallon.visible == true && tuxon.visible == true) { small() } if(Activity.voltage == 100 && residentsmallon.visible == true && tuxon.visible != true) { small() - stepdownwire.visible= false + stepdownwire.visible = false } } if(Activity.currentLevel == 2) { if(Activity.voltage == 0 && residentsmallon.visible == true && tuxon.visible == true && residentbigon.visible == true) { tux() small() big() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible == true && tuxon.visible == true && residentbigon.visible != true) { tux() small() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible != true && tuxon.visible == true && residentbigon.visible == true) { tux() big() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible == true && tuxon.visible != true && residentbigon.visible == true) { big() small() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible == true && tuxon.visible != true && residentbigon.visible != true) { small() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible != true && tuxon.visible == true && residentbigon.visible != true) { tux() - stepdownwire.visible= false + stepdownwire.visible = false } if(Activity.voltage == 0 && residentsmallon.visible != true && tuxon.visible != true && residentbigon.visible == true) { big() - stepdownwire.visible= false + stepdownwire.visible = false } if (Activity.voltage == 100 && tuxon.visible == true && residentsmallon.visible == true && residentbigon.visible == true) { small() big() } + if (Activity.voltage == 100 && tuxon.visible == true &&residentsmallon.visible == true && residentbigon.visible != true) { small() } - if (Activity.voltage == 500 || Activity.voltage == 400 && residentbigon.visible == true) + + if (Activity.voltage == 400 && residentsmallon.visible == true && residentbigon.visible == true) { big() } + + if (Activity.voltage == 500 && residentbigon.visible == true) + { + big() + } + } } function checkbonus() { if(Activity.currentLevel == 0 && tuxon.visible == true) { Activity.win() } if(Activity.currentLevel == 1 && tuxon.visible == true && residentsmallon.visible == true) { Activity.win() } if(Activity.currentLevel == 2 && tuxon.visible == true && residentbigon.visible == true && residentsmallon.visible == true) { Activity.win() } } onStart: { Activity.start(items,pow,solar,tux_meter) } 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) } } } diff --git a/src/activities/hydroelectric/Solar.qml b/src/activities/hydroelectric/Solar.qml index 42a19bb3b..db4ab7d8d 100644 --- a/src/activities/hydroelectric/Solar.qml +++ b/src/activities/hydroelectric/Solar.qml @@ -1,186 +1,136 @@ /* GCompris - solar.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 "hydroelectric.js" as Activity +import "../../core" Item { id: solar - property int clicks: 0 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 visible: false anchors.fill: solar_transformer onClicked: { - if(clicks == 0 ) { - solarpoweron.visible= true - solarpoweroff.visible= false - solar_info.text= qsTr("400 W") + if(Activity.click == false && Activity.panel_activate == true) { + solarpower.source = activity.url + "solar/solarpoweron.svg" + solar_info.text = "400 W" + Activity.click = true Activity.add(400) Activity.volt(400) - clicks= 1 - Activity.solargrid(clicks) Activity.update() } else { - solarpoweron.visible= false - solarpoweroff.visible= true - solar_info.text= qsTr("0 W") + solarpower.source = activity.url + "solar/solarpoweroff.svg" + solar_info.text = "0 W" + Activity.click = false Activity.add(-400) - clicks= 0 Activity.volt(-400) - Activity.solargrid(clicks) Activity.update() Activity.verify() } } } } Image{ source: activity.url + "left.svg" sourceSize.width: solar_transformer.width/2 sourceSize.height: solar_transformer.height/2 anchors { top: solarpaneloff.top left:solar_transformer.left leftMargin: solar_transformer.width topMargin: solar_transformer.height } Rectangle{ - width: solar_info.width*1.5 + width: solar_info.width*1.1 height: solar_info.height*1.1 border.color: "black" radius :5 color:"yellow" anchors { left: parent.right } - Text { + GCText { id: solar_info + fontSize: smallSize * 0.5 anchors.centerIn: parent - text: qsTr("0 W") + text: "0 W" } } - } Image { - id: solarpoweroff + id: solarpower source: activity.url + "solar/solarpoweroff.svg" sourceSize.width: parent.width anchors.fill: parent visible: true } - Image { - id: solarpoweron - source: activity.url + "solar/solarpoweron.svg" - sourceSize.width: parent.width - anchors.fill: parent - visible: false - } - 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 { id: solarpanelarea anchors.fill: solarpaneloff onClicked: { - if( Activity.panel_activate == true && Activity.flag == 0) { - solar_area.visible= true - solarpaneloff.source= activity.url + "solar/solarpanelon.svg" - // solarpaneloff.visible= false - //solarpanelon.visible= true - panelpoweron.visible= true - panelpoweroff.visible= false + if( Activity.panel_activate == true ) { + solar_area.visible = true + solarpaneloff.source = activity.url + "solar/solarpanelon.svg" + panelpower.source = activity.url + "solar/panelpoweron.svg" solarpanelarea.visible= false } } } } - Image { - id: panelpoweroff + id: panelpower source: activity.url + "solar/panelpoweroff.svg" sourceSize.width: parent.width anchors.fill: parent 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 - // } - // visible: false - // MouseArea { - // anchors.fill: solarpanelon - // onClicked: { - // solar_area.visible= false - // solarpanelon.visible= false - // solarpaneloff.visible= true - // panelpoweron.visible= false - // panelpoweroff.visible= true - // } - // } - // } - - Image { - id: panelpoweron - source: activity.url + "solar/panelpoweron.svg" - sourceSize.width: parent.width - anchors.fill: parent - visible: false - } - - } diff --git a/src/activities/hydroelectric/Wind.qml b/src/activities/hydroelectric/Wind.qml index 3b77acd29..fc223ae50 100644 --- a/src/activities/hydroelectric/Wind.qml +++ b/src/activities/hydroelectric/Wind.qml @@ -1,248 +1,250 @@ /* GCompris - wind.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 "hydroelectric.js" as Activity +import "../../core" Item { id: wind - property int click: 0 + property bool active: false 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 } MouseArea { anchors.fill: cloud_quiet onClicked: { - cloud_quiet.source= activity.url+ "wind/cloud_fury.svg" - turbine_area.visible= true - wind.state= "move" + cloud_quiet.source = activity.url+ "wind/cloud_fury.svg" + turbine_area.visible = true + wind.state = "move" wind_timer.restart() } } } 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 } MouseArea { id: wind_transformer_area anchors.fill: wind_transformer visible: false onClicked: { - if(click == 0) { - wind_power.source= activity.url + "wind/windpoweron.svg" - click = 1 + if(active == false) { + wind_power.source = activity.url + "wind/windpoweron.svg" + active = true Activity.add(100) Activity.volt(100) - windvoltage.text= qsTr("100 W") + windvoltage.text = "100 W" Activity.update() } else { - click = 0 - wind_power.source= activity.url + "wind/windpoweroff.svg" + active = false + wind_power.source = activity.url + "wind/windpoweroff.svg" Activity.add(-100) Activity.volt(-100) - windvoltage.text= qsTr("0 W") + windvoltage.text = "0 W" Activity.update() Activity.verify() } } } } Image{ sourceSize.width: wind_transformer.width/2 sourceSize.height: wind_transformer.height/2 - source: activity.url + "up.svg" + source: activity.url + "down.svg" anchors { - top: wind_transformer.top - topMargin: wind_transformer.height*0.9 + bottom: wind_transformer.top right: parent.right - rightMargin: parent.width*0.18 + rightMargin: parent.width*0.20 } Rectangle{ - width: windvoltage.width*1.5 + width: windvoltage.width*1.1 height: windvoltage.height*1.1 border.color: "black" radius :5 color:"yellow" anchors { - top: parent.bottom + bottom: parent.top + right: parent.right } - Text { + GCText { id: windvoltage anchors.centerIn: parent - text: qsTr("0 W") + text: "0 W" + fontSize: smallSize * 0.5 } } } Image { id: wind_power source: activity.url + "wind/windpoweroff.svg" sourceSize.width: parent.width sourceSize.height: parent.height anchors.fill: parent opacity: 1 } Image { id: wind_turbine source: activity.url + "wind/windturbineoff.svg" sourceSize.width: parent.width sourceSize.height: parent.height anchors.fill: parent opacity: 1 } //wind turbines animations Image { id:turbine1 source: activity.url + "wind/turbine1.svg" visible: true 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 } } MouseArea { anchors.fill: turbine1 id: turbine_area visible: false onClicked: { wind_turbine.source= activity.url + "wind/windturbineon.svg" - wind_transformer_area.visible= true + wind_transformer_area.visible = true } } Image { id:turbine2 visible: false source: activity.url + "wind/turbine2.svg" 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 } } states: [ State { name: "move" PropertyChanges { target: turbine1 visible: false } PropertyChanges { target: turbine2 visible: true } }, State { name: "off" PropertyChanges { target: turbine2 visible: false } PropertyChanges { target: turbine1 visible: true } } ] transitions: Transition { SequentialAnimation { loops: Animation.Infinite NumberAnimation { easing.type: Easing.InQuad properties: "visible" duration: 2000 } } } Timer { id: wind_timer interval: 10000 running: false repeat: false - onTriggered: click == 0 ? wind_reset() : wind_power_reset() + onTriggered: active == false ? wind_reset() : wind_power_reset() } function wind_reset() { cloud_quiet.source = activity.url+ "wind/cloud_quiet.svg" wind_power.source= activity.url + "wind/windpoweroff.svg" - wind_turbine.source= activity.url + "wind/windturbineoff.svg" - turbine_area.visible= false - state= "off" - windvoltage.text= qsTr("0 W") - wind_transformer_area.visible= false + wind_turbine.source = activity.url + "wind/windturbineoff.svg" + turbine_area.visible = false + state = "off" + windvoltage.text = "0 W" + wind_transformer_area.visible = false wind_timer.stop() } function wind_power_reset() { cloud_quiet.source = activity.url+ "wind/cloud_quiet.svg" - wind_turbine.source= activity.url + "wind/windturbineoff.svg" - state= "off" + wind_turbine.source = activity.url + "wind/windturbineoff.svg" + state = "off" wind_power.source= activity.url + "wind/windpoweroff.svg" - wind_transformer_area.visible= false + wind_transformer_area.visible = false turbine_area.visible= false - click= 0 + active = false Activity.add(-100) Activity.volt(-100) - windvoltage.text= qsTr("0 W") + windvoltage.text = "0 W" Activity.update() Activity.verify() wind_timer.stop() } } diff --git a/src/activities/hydroelectric/hydroelectric.js b/src/activities/hydroelectric/hydroelectric.js index ad0e1ead3..bbf5487dc 100755 --- a/src/activities/hydroelectric/hydroelectric.js +++ b/src/activities/hydroelectric/hydroelectric.js @@ -1,146 +1,137 @@ /* GCompris - hydroelectric.js * * 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 . */ .pragma library .import QtQuick 2.0 as Quick var currentLevel = 0 var numberOfLevel = 3 var items var power = 0 var count = 0 var pow var voltage = 0 -var panel_activate = false var solar -var clicks = 0 -var flag = 0 +var click = false var tux_meter var tuxreached = false var scene = false +var panel_activate = false function start(items_,pow_,solar_,tux_meter_) { items = items_ currentLevel = 0 initLevel() pow = pow_ solar = solar_ panel_activate= false tux_meter = tux_meter_ tux_meter.visible = false tuxreached = false } function stop() { } function initLevel() { items.bar.level = currentLevel + 1 items.background.initiate() power = 0 count = 0 voltage = 0 - flag = 0 - panel_activate = false scene = false + panel_activate = false + click = false } function nextLevel() { if(numberOfLevel <= ++currentLevel ) { currentLevel = 0 } initLevel(); } function previousLevel() { if(--currentLevel < 0 ) { currentLevel = numberOfLevel - 1 } initLevel(); } function win() { items.bonus.good("flower") } function add(power_) { power = power + power_ } function volt(voltage_) { voltage = voltage + voltage_ } function consume(count_) { count = count + count_ } function update() { pow.text = (voltage.toString()).concat("W") } function verify() { if(power < count) { items.background.reset() } } -function panel(panel_activate_) { - panel_activate = panel_activate_ -} - function paneloff() { - solar.source= "" - solar.source="Solar.qml" - if(clicks == 1) { + solar.source = "" + solar.source = "Solar.qml" + if(click == true) { add(-400) volt(-400) update() verify() + click = false } - flag = 1 } -function solargrid(clicks_) { - clicks = clicks_ +function panel() { + panel_activate = true } function showtuxmeter() { if(tuxreached == true) { tux_meter.visible = true } } function sceneload(scene_) { scene = scene_ if(scene == false) { - - items.daysky.source= "resource/sky.svg" - items.moon.visible= false + items.daysky.source = "resource/sky.svg" } else { items.daysky.source = "../intro_gravity/resource/background.svg" - items.moon.visible= true - } }