- modelData.method of – has got the symbol title, elizabeth.g. “rum”, “parrot”, “captain”, .
- modelData.regularity – holds brand new frequency property value the brand new symbol.
- modelData.data – provides the custom representative analysis of your icon. We could use this to get into the picture supply setup off all of our icons.
One which officiƫle cloudbet-site fulfills brand new slot machine game that have a back ground, another type of suggests light traces once the a line between the reels. Which image is positioned above the background together with created symbols of the means the z assets.
Putting Everything To one another
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // complete game windows having record Rectangle < // . > // create video slot FlaskOfRumMachine < anchors.centerIn: moms and dad defaultItemHeight: 80 // visualize peak 70 + 5 margin most readily useful + 5 margin bottom (Symbol.qml) defaultReelWidth: 67 // picture depth > // . > >
After we condition transfer “slotmachine” , we are able to range from the component. I point they in the middle of the view and you may specify the brand new default thickness and you can level on the affairs and you may reels. As we don’t put a particular top in regards to our icons, the latest standard viewpoints are used for all of them. When you strike gamble, it already lookup a little an effective. However, at the a close look, the fresh fixed top allows blank elements above otherwise beneath the slot host.
Let’s genuine that! Even though we are during the they, we are able to together with bring what you to life adding good handler towards twistEnded rule and using brand new startSlotMachine() mode.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // include slot machine FlaskOfRumMachine < id: slotMachine // i heart they horzizontally and you can circulate it ten px "under" the big club // given that image of brand new club casts a trace towards the for the brand new video slot anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we want this new slot machine game to help you auto-size according to available top // the brand new slotmachine use the game screen height with the exception of the new topBar and you will bottomBar town // as with the big club, the bottom pub together with casts a trace on the so you're able to position server height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // we upcoming assess the fresh new default goods top in accordance with the genuine slotmachine top and you will row amount defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and alter the fresh new reel thickness to match the item level (to keep up the latest depth/peak proportion of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // velocity out-of twist should drop off/boost as well as product top spinVelocity: Math.round(defaultItemHeight / 80 750) // link laws in order to handler setting onSpinEnded: scene.spinEnded() > // . // start slot machine game function startSlotMachine() < if(!slotMachine.spinning && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // treat athlete credits scene.creditAmount -= scene.betAmount // begin servers var stopInterval = utils.generateRandomValueBetween(five-hundred, 1000) // anywhere between five hundred and you may 1000 ms slotMachine.spin(stopInterval) > > // handle twist is fully gone rule function spinEnded() < bottomBar.startActive = not the case if(bottomBar.autoActive) startSlotMachine() > > >
Therefore we move new slot machine 10px right up to allow brand new topbar and the slotmachine convergence a while
I start by aligning the entire slot machine game below the top pub. Nevertheless the topbar picture also incorporates a shadow at the bottom. Just like the better bar is put in addition position servers, they casts its shade onto it. The same pertains to the beds base bar. Simply one to in this instance, the latest height of your video slot is determined properly to let they overlap towards base bar.
Just after function a working height towards the casino slot games centered on the brand new available room, we together with calculate the brand new width and you may level of one’s icons consequently. And as the very last step i as well as measure the brand new spin speed as well as the goods peak. If we don’t lay a working course speed, a slot machine which have less symbols would appear reduced.
