diff --git a/src/activities/activities.txt b/src/activities/activities.txt index 14d4f20d9..c63d7115f 100644 --- a/src/activities/activities.txt +++ b/src/activities/activities.txt @@ -1,133 +1,134 @@ # The list of activities that will be loaded at GCompris start. # Keep it sorted advanced_colors algebra_by algebra_div algebra_minus algebra_plus algorithm align4 align4-2players alphabet-sequence +baby_wordprocessor babymatch babyshapes -baby_wordprocessor balancebox ballcatch braille_alphabets braille_fun canal_lock chess chess_2players chess_partyend chronos -clickanddraw -clickgame click_on_letter click_on_letter_up +clickanddraw +clickgame clockgame color_mix color_mix_light colors crane details drawletters drawnumbers enumerate erase erase_2clic erase_clic explore_farm_animals explore_monuments explore_world_animals explore_world_music fifteen followline football geo-country geography gletters gnumch-equality gnumch-factors gnumch-inequality gnumch-multiples gnumch-primes graph-coloring guessnumber hangman hanoi hanoi_real hexagon imagename instruments intro_gravity land_safe lang leftright letter-in-word lightsoff louis-braille magic-hat-minus magic-hat-plus maze mazeinvisible mazerelative melody memory memory-enumerate memory-math-add memory-math-add-minus memory-math-add-minus-mult-div memory-math-add-minus-mult-div-tux memory-math-add-minus-tux memory-math-add-tux memory-math-div memory-math-div-tux memory-math-minus memory-math-minus-tux memory-math-mult memory-math-mult-div memory-math-mult-div-tux memory-math-mult-tux memory-sound memory-sound-tux memory-tux memory-wordnumber mining missing-letter money money_back money_back_cents money_cents mosaic nine_men_morris nine_men_morris_2players number_sequence numbers-odd-even paintings penalty photo_hunter planegame +railroad readingh readingv redraw redraw_symmetrical renewable_energy reversecount roman_numerals scalesboard scalesboard_weight scalesboard_weight_avoirdupois share simplepaint smallnumbers smallnumbers2 sudoku superbrain tangram target tic_tac_toe tic_tac_toe_2players traffic watercycle wordsgame diff --git a/src/activities/railroad/.!1184!ActivityInfo.qml b/src/activities/railroad/.!1184!ActivityInfo.qml new file mode 100644 index 000000000..e69de29bb diff --git a/src/activities/railroad/ActivityInfo.qml b/src/activities/railroad/ActivityInfo.qml new file mode 100644 index 000000000..66c3b4f61 --- /dev/null +++ b/src/activities/railroad/ActivityInfo.qml @@ -0,0 +1,35 @@ +/* GCompris - ActivityInfo.qml + * + * Copyright (C) 2016 Your Name + * + * 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: "railroad/Railroad.qml" + difficulty: 1 + icon: "railroad/railroad.svg" + author: "Your Name <yy@zz.org>" + demo: true + title: "Railroad activity" + description: "" + //intro: "put here in comment the text for the intro voice" + goal: "" + prerequisite: "" + manual: "" + credit: "" + section: "fun" + createdInVersion: 7000 +} diff --git a/src/activities/railroad/CMakeLists.txt b/src/activities/railroad/CMakeLists.txt new file mode 100644 index 000000000..824c03727 --- /dev/null +++ b/src/activities/railroad/CMakeLists.txt @@ -0,0 +1 @@ +GCOMPRIS_ADD_RCC(activities/railroad *.qml *.svg *.js resource/*) diff --git a/src/activities/railroad/Railroad.qml b/src/activities/railroad/Railroad.qml new file mode 100644 index 000000000..a6d07f8ea --- /dev/null +++ b/src/activities/railroad/Railroad.qml @@ -0,0 +1,115 @@ +/* GCompris - railroad.qml + * + * Copyright (C) 2016 YOUR NAME + * + * Authors: + * (GTK+ version) + * YOUR NAME (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 "../../core" +import "railroad.js" as Activity + +ActivityBase { + id: activity + + onStart: focus = true + onStop: {} + + property string resourceURL: "qrc:/gcompris/src/activities/railroad/resource/" + + pageComponent: Image { + id: background + source: resourceURL + "railroad-bg.svg" + height: activity.height / 2 + width: activity.width + 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 + } + + onStart: { Activity.start(items) } + onStop: { Activity.stop() } + +// GCText { +// anchors.centerIn: parent +// text: "UTKARSH TIWARI" +// fontSize: largeSize +// } + + Rectangle { + id: railCollection + Flow { + id: railCarriages + x: 2 + y: background.height / 4.7 + height: background.height - (background.height / 5) + width: background.width + anchors.margins: 1 + spacing: 4 + + flow: Flow.LeftToRight + //layoutDirection: Grid.LeftToRight + + Repeater { + model: 22 + Image { + source: resourceURL + "loco" + (index + 1) + ".svg" + height: background.height / 7.5 + width: background.width / Activity.railWidthArray[index] + visible: true + } + } + } + } + + 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/railroad/railroad.js b/src/activities/railroad/railroad.js new file mode 100644 index 000000000..e18fb32fd --- /dev/null +++ b/src/activities/railroad/railroad.js @@ -0,0 +1,57 @@ +/* GCompris - railroad.js + * + * Copyright (C) 2016 YOUR NAME + * + * Authors: + * (GTK+ version) + * "YOUR NAME" (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 = 4 +var noOfCarriages = [4, 5, 4, 4, 5] +var railWidthArray = [5, 4, 3.8, 3.8, 5, 6.5, 6.5, 3.8, 6.5, 4, 4, + 4, 4.5, 4, 4, 4.5, 4, 5, 5.5, 6.5, 6.5, 3.8] +var items + +function start(items_) { + items = items_ + currentLevel = 0 + initLevel() +} + +function stop() { +} + +function initLevel() { + items.bar.level = currentLevel + 1 +} + +function nextLevel() { + if(numberOfLevel <= ++currentLevel ) { + currentLevel = 0 + } + initLevel(); +} + +function previousLevel() { + if(--currentLevel < 0) { + currentLevel = numberOfLevel - 1 + } + initLevel(); +} diff --git a/src/activities/railroad/railroad.svg b/src/activities/railroad/railroad.svg new file mode 100644 index 000000000..8f55bee45 --- /dev/null +++ b/src/activities/railroad/railroad.svg @@ -0,0 +1,139 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/activities/railroad/resource/loco1.svg b/src/activities/railroad/resource/loco1.svg new file mode 100644 index 000000000..af48a86dd --- /dev/null +++ b/src/activities/railroad/resource/loco1.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco10.svg b/src/activities/railroad/resource/loco10.svg new file mode 100644 index 000000000..731249d05 --- /dev/null +++ b/src/activities/railroad/resource/loco10.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco11.svg b/src/activities/railroad/resource/loco11.svg new file mode 100644 index 000000000..3457a56cc --- /dev/null +++ b/src/activities/railroad/resource/loco11.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco12.svg b/src/activities/railroad/resource/loco12.svg new file mode 100644 index 000000000..96c44928f --- /dev/null +++ b/src/activities/railroad/resource/loco12.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco13.svg b/src/activities/railroad/resource/loco13.svg new file mode 100644 index 000000000..11658485b --- /dev/null +++ b/src/activities/railroad/resource/loco13.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco14.svg b/src/activities/railroad/resource/loco14.svg new file mode 100644 index 000000000..5517e2585 --- /dev/null +++ b/src/activities/railroad/resource/loco14.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco15.svg b/src/activities/railroad/resource/loco15.svg new file mode 100644 index 000000000..12f147c4e --- /dev/null +++ b/src/activities/railroad/resource/loco15.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco16.svg b/src/activities/railroad/resource/loco16.svg new file mode 100644 index 000000000..84024f2fc --- /dev/null +++ b/src/activities/railroad/resource/loco16.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco17.svg b/src/activities/railroad/resource/loco17.svg new file mode 100644 index 000000000..acaca39b0 --- /dev/null +++ b/src/activities/railroad/resource/loco17.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco18.svg b/src/activities/railroad/resource/loco18.svg new file mode 100644 index 000000000..57512127f --- /dev/null +++ b/src/activities/railroad/resource/loco18.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco19.svg b/src/activities/railroad/resource/loco19.svg new file mode 100644 index 000000000..c54eef426 --- /dev/null +++ b/src/activities/railroad/resource/loco19.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco2.svg b/src/activities/railroad/resource/loco2.svg new file mode 100644 index 000000000..297567aea --- /dev/null +++ b/src/activities/railroad/resource/loco2.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco20.svg b/src/activities/railroad/resource/loco20.svg new file mode 100644 index 000000000..a0034c2cb --- /dev/null +++ b/src/activities/railroad/resource/loco20.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco21.svg b/src/activities/railroad/resource/loco21.svg new file mode 100644 index 000000000..a97ad93f0 --- /dev/null +++ b/src/activities/railroad/resource/loco21.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco22.svg b/src/activities/railroad/resource/loco22.svg new file mode 100644 index 000000000..38f5a7b61 --- /dev/null +++ b/src/activities/railroad/resource/loco22.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco3.svg b/src/activities/railroad/resource/loco3.svg new file mode 100644 index 000000000..7fa826697 --- /dev/null +++ b/src/activities/railroad/resource/loco3.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco4.svg b/src/activities/railroad/resource/loco4.svg new file mode 100644 index 000000000..48d9cdfee --- /dev/null +++ b/src/activities/railroad/resource/loco4.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco5.svg b/src/activities/railroad/resource/loco5.svg new file mode 100644 index 000000000..783e8957c --- /dev/null +++ b/src/activities/railroad/resource/loco5.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco6.svg b/src/activities/railroad/resource/loco6.svg new file mode 100644 index 000000000..920801139 --- /dev/null +++ b/src/activities/railroad/resource/loco6.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco7.svg b/src/activities/railroad/resource/loco7.svg new file mode 100644 index 000000000..7c98b4cb3 --- /dev/null +++ b/src/activities/railroad/resource/loco7.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco8.svg b/src/activities/railroad/resource/loco8.svg new file mode 100644 index 000000000..052cb6477 --- /dev/null +++ b/src/activities/railroad/resource/loco8.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/loco9.svg b/src/activities/railroad/resource/loco9.svg new file mode 100644 index 000000000..ac79f16a4 --- /dev/null +++ b/src/activities/railroad/resource/loco9.svg @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/activities/railroad/resource/railroad-bg.svg b/src/activities/railroad/resource/railroad-bg.svg new file mode 100644 index 000000000..b66bfc197 --- /dev/null +++ b/src/activities/railroad/resource/railroad-bg.svg @@ -0,0 +1,1248 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file