Warning, /education/gcompris/src/activities/gnumch-equality/Muncher.qml is written in an unsupported language. File is not indexed.
0001 /* GCompris - Muncher.qml 0002 * 0003 * SPDX-FileCopyrightText: 2014 Manuel Tondeur <manueltondeur@gmail.com> 0004 * 0005 * Authors: 0006 * Joe Neeman (spuzzzzzzz@gmail.com) (GTK+ version) 0007 * Manuel Tondeur <manueltondeur@gmail.com> (Qt Quick port) 0008 * 0009 * SPDX-License-Identifier: GPL-3.0-or-later 0010 */ 0011 import QtQuick 2.12 0012 import GCompris 1.0 0013 0014 import "gnumch-equality.js" as Activity 0015 0016 Creature { 0017 function getCaught(index) { 0018 if (!movable) { 0019 return 0020 } 0021 0022 caughted = true 0023 0024 opacity = 0 0025 warningRect.setFault(index) 0026 warningRect.opacity = 1 0027 0028 spawningMonsters.stop() 0029 monsters.setMovable(false) 0030 if (topPanel.life.opacity != 1) { 0031 bonus.bad("gnu") 0032 } 0033 } 0034 0035 property bool caughted: false 0036 0037 monsterType: "muncher" 0038 frames: 4 0039 Drag.active: ApplicationInfo.isMobile ? muncherArea.drag.active : false 0040 Drag.hotSpot.x: width / 2 0041 Drag.hotSpot.y: height / 2 0042 movable: opacity == 1 0043 0044 onMovingOnChanged: { 0045 if (movingOn == false && caughted) { 0046 init() 0047 caughted = false 0048 } 0049 } 0050 0051 onIndexChanged: { 0052 audioEffects.stop() 0053 if(opacity == 1) 0054 audioEffects.play("qrc:/gcompris/src/core/resource/sounds/smudge.wav") 0055 0056 if (monsters.isThereAMonster(index)) { 0057 getCaught(-1) 0058 } 0059 } 0060 0061 onOpacityChanged: { 0062 if (opacity == 0) { 0063 init() 0064 } 0065 } 0066 }