- modelData.type – has the symbol name, e.grams. “rum”, “parrot”, “captain”, .
- modelData.volume – retains this new regularity worth of the brand new symbol.
- modelData.analysis – provides the individualized member analysis of icon. We are able to make use of this to access the image supply configuration out of our very own icons.
One that fills the brand new casino slot games having a casinoly officiële site back ground, another type of shows light lines while the an edge amongst the reels. So it photo is positioned over the history in addition to written symbols by the mode new z possessions.
Getting Everything Together
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // complete game windows with records Rectangle < // . > // include slot machine game FlaskOfRumMachine < anchors.centerIn: mother or father defaultItemHeight: 80 // image level 70 + 5 margin best + 5 margin base (Icon.qml) defaultReelWidth: 67 // picture width > // . > >
Even as we county transfer “slotmachine” , we could range from the component. We anchor it in the exact middle of the view and you can specify the fresh new default thickness and you may peak towards activities and you can reels. Once we failed to set a certain top for our symbols, the fresh standard opinions are used for all of them. Once you struck play, this currently research somewhat an excellent. But during the a close look, the fresh new repaired peak allows blank components over otherwise beneath the slot server.
Let us true that! And even though the audience is within it, we can including offer what you to life with the addition of a great handler towards spinEnded code and implementing brand new startSlotMachine() setting.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // create casino slot games FlaskOfRumMachine < id: slotMachine // we center they horzizontally and you will move they ten px "under" the top pub // as image of the latest club casts a shadow towards the to the brand new slot machine anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we need the newest slot machine so you're able to auto-proportions depending on the offered peak // the fresh slotmachine uses the game screen top apart from the latest topBar and you can bottomBar town // like with the top pub, the base pub also casts a shadow towards to help you position servers height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // i following determine the standard item height in accordance with the genuine slotmachine height and row amount defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and change brand new reel depth to match the object top (to maintain the width/level ratio of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // velocity from spin will be disappear/increase in addition to goods height spinVelocity: Math.round(defaultItemHeight / 80 750) // connect laws to handler means onSpinEnded: scene.spinEnded() > // . // initiate casino slot games function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // eliminate player credits scene.creditAmount -= scene.betAmount // initiate server var stopInterval = utils.generateRandomValueBetween(500, 1000) // between five-hundred and you will 1000 ms slotMachine.spin(stopInterval) > > // manage spin is fully gone laws function spinEnded() < bottomBar.startActive = not the case if(bottomBar.autoActive) startSlotMachine() > > >
Therefore we disperse the fresh slot machine game 10px upwards to allow this new topbar plus the slotmachine overlap a little while
We start by aligning the entire slot machine beneath the best bar. Although topbar image also contains a shade in the bottom. Since the better club is positioned on top of the slot host, it casts their trace on it. The same applies to the beds base club. Merely that in this case, brand new top of your own slot machine game is set properly so that they convergence into the bottom pub.
Just after form an active height to the slot machine game according to the fresh offered room, i in addition to estimate this new width and you may height of your own icons correctly. And as the past step we also scale the fresh new spin acceleration plus the product level. When we did not put an energetic way acceleration, a casino slot games that have smaller icons seems faster.