- modelData.type – has got the symbol name, age.grams. “rum”, “parrot”, “captain”, .
- modelData.regularity – keeps the newest frequency worth of this new symbol.
- modelData.data – contains the customized member investigation of one’s symbol. We are able to make use of this to view the picture provider configuration out of our very own symbols.
One that fulfills the fresh new slot machine that have a backgbullet, another suggests light navegar até este site traces just like the a border within reels. This picture is placed above the records plus the authored icons from the mode the new z possessions.
Placing Everything To each other
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // fill games screen with record Rectangle < // . > // add slot machine game FlaskOfRumMachine < anchors.centerIn: parent defaultItemHeight: 80 // visualize peak 70 + 5 margin finest + 5 margin base (Icon.qml) defaultReelWidth: 67 // image width > // . > >
After we condition import “slotmachine” , we could add the parts. I anchor they in the exact middle of the world and you may specify the fresh new default width and you may level into factors and reels. As we failed to lay a specific top in regards to our signs, the fresh new standard thinking are used for them. After you strike gamble, that it already look somewhat an effective. But on a close look, the fixed height allows blank parts significantly more than otherwise beneath the position machine.
Let’s correct that! Even though the audience is at the it, we could and additionally promote that which you alive with the addition of a beneficial handler toward twistEnded signal and you may using the brand new startSlotMachine() setting.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // create slot machine FlaskOfRumMachine < id: slotMachine // we center it horzizontally and you may circulate it ten px "under" the big pub // as picture of the fresh new club casts a shade toward to the the fresh slot machine game anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we need new slot machine to help you auto-dimensions with respect to the readily available peak // the latest slotmachine will use the overall game screen peak except for brand new topBar and you can bottomBar urban area // just as in the top bar, the bottom club and additionally casts a shade on so you're able to position host height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // i upcoming determine brand new standard goods top according to the real slotmachine height and row count defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and alter the reel width to suit the thing height (to keep up the fresh depth/height proportion of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // speed away from spin is fall off/increase including goods height spinVelocity: Math.round(defaultItemHeight / 80 750) // hook rule to handler form onSpinEnded: scene.spinEnded() > // . // begin casino slot games function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // get rid of member credits scene.creditAmount -= scene.betAmount // start servers var stopInterval = utils.generateRandomValueBetween(500, 1000) // between five-hundred and 1000 ms slotMachine.spin(stopInterval) > > // manage twist is finished rule function spinEnded() < bottomBar.startActive = not true if(bottomBar.autoActive) startSlotMachine() > > >
Therefore we move the newest slot machine game 10px right up to let new topbar as well as the slotmachine convergence some time
We start by aligning the complete slot machine game below the top bar. But the topbar photo comes with a trace at the bottom. Because finest bar is put on top of the position servers, it casts its trace upon it. A similar applies to the base bar. Only one in this case, new peak of your own casino slot games is decided correctly to allow they convergence on base club.
Immediately following form a working peak on casino slot games centered on the fresh new offered area, we also estimate the latest depth and height of your icons consequently. So when the final step we along with size the new twist acceleration in addition to the product height. When we don’t set an active way velocity, a slot machine which have smaller symbols would seem reduced.
