One Card! - Multiplayer Card Game
import QtQuick 2.0
import Felgo 3.0
import "../common"
Item {
id: onuButton
width: 110
height: 110
property alias button: button
property alias blinkAnimation: blinkAnimation
SoundEffect {
volume: 0.5
id: onuSound
source: "../../assets/snd/onu.wav"
}
ButtonBase {
id: button
radius: width/2
enabled: false
anchors.fill: parent
onClicked: {
if(onuButton.visible) {
ga.logEvent("User", "ONU", "singlePlayer", multiplayer.singlePlayer)
flurry.logEvent("User.ONU", "singlePlayer", multiplayer.singlePlayer)
button.enabled = false
onu(multiplayer.localPlayer.userId)
}
}
onEnabledChanged: {
if (enabled){
blinkAnimation.start()
} else {
blinkAnimation.stop()
}
}
}
Image {
id: onuButton1
anchors.fill: parent
source: "../../assets/img/ONUButton1.png"
smooth: true
}
Image {
id: onuButton2
anchors.fill: parent
source: "../../assets/img/ONUButton2.png"
opacity: 0
smooth: true
}
SequentialAnimation {
id: blinkAnimation
running: false
loops: Animation.Infinite
alwaysRunToEnd: true
NumberAnimation { target: onuButton2; property: "opacity"; easing.type: Easing.InOutQuad; to: 1.0; duration: 400 }
NumberAnimation { target: onuButton2; property: "opacity"; easing.type: Easing.InOutQuad; to: 0.0; duration: 400 }
}
function onu(userId){
onuSound.play()
var hand = gameLogic.getHand(userId)
if (hand) hand.onu = true