- modelData.kind of – provides the symbol name, age.g. “rum”, “parrot”, “captain”, .
- modelData.volume – retains the new frequency worth of the fresh new symbol.
- modelData.data – contains the personalized representative analysis of your symbol. We can use this to view the picture source configuration off all of our signs.
The one that fills the slot machine game having a backgbullet, another shows white contours as a border between the reels. So it picture is positioned over the history therefore the authored symbols by form brand new z property.
Placing Everything you Together
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // fill games windows that have record Rectangle < // . > // create video slot FlaskOfRumMachine < anchors.centerIn: mother defaultItemHeight: 80 // photo peak 70 + 5 margin ideal + 5 margin base (Symbol.qml) defaultReelWidth: 67 // picture depth > // . > >
If bingo games we condition transfer “slotmachine” , we could are the component. I point it in the world and you can indicate brand new standard thickness and you may height with the points and reels. While we don’t put a certain peak in regards to our symbols, the fresh default thinking are used for all of them. When you strike enjoy, which currently lookup a little a beneficial. But at a close look, the newest repaired peak allows blank section significantly more than or below the position machine.
Let us correct that! Although we have been in the they, we can plus promote what you to life with the addition of a beneficial handler towards twistEnded rule and you may implementing the fresh startSlotMachine() function.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // add slot machine game FlaskOfRumMachine < id: slotMachine // i heart they horzizontally and you can circulate they ten px "under" the big bar // while the image of this new pub casts a shadow to the into the the new video slot anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we truly need the fresh video slot to car-proportions with regards to the available height // new slotmachine will use the overall game windows top except for the newest topBar and you will bottomBar town // as with the big club, the base club including casts a shadow on so you're able to slot machine height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // we up coming estimate brand new standard item level in line with the genuine slotmachine height and you can line amount defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and change the new reel depth to suit the object height (to keep up the width/top proportion of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // velocity regarding twist would be to drop off/boost along with goods peak spinVelocity: Math.round(defaultItemHeight / 80 750) // connect laws to handler function onSpinEnded: scene.spinEnded() > // . // initiate casino slot games function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // eradicate user credit scene.creditAmount -= scene.betAmount // start machine var stopInterval = utils.generateRandomValueBetween(five hundred, 1000) // between five-hundred and you can 1000 ms slotMachine.spin(stopInterval) > > // manage twist is gone code function spinEnded() < bottomBar.startActive = untrue if(bottomBar.autoActive) startSlotMachine() > > >
Therefore we disperse the new slot machine game 10px upwards to let the latest topbar additionally the slotmachine convergence a while
I begin by straightening the complete slot machine beneath the best bar. However the topbar photo comes with a shade at the bottom. Since the top club is placed on top of the slot machine, it casts its shade about it. An identical pertains to the bottom pub. Merely one in this case, new peak of the slot machine game is determined correctly so that they convergence into the base pub.
Immediately after function a dynamic peak into video slot based on new available space, i including calculate the depth and you may level of your symbols correctly. So when the final action we plus scale the fresh new twist velocity in addition to the item peak. When we did not lay an energetic movement velocity, a video slot which have reduced symbols would seem shorter.
