- modelData.method of – provides the symbol identity, elizabeth.grams. “rum”, “parrot”, “captain”, .
- modelData.volume – keeps the volume worth of this new symbol.
- modelData.data – has the custom associate studies of your own icon. We could make use of this to view the picture origin arrangement out-of our very own icons.
One which fulfills the fresh slot machine game having a background, a new shows white contours once the a border amongst the reels. It visualize is put above the background and composed icons by form new z assets.
Getting That which you Together
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // fill online game screen that have background Rectangle < // . > // include casino slot games FlaskOfRumMachine < anchors.centerIn: parent defaultItemHeight: 80 // picture top 70 + 5 margin better + 5 margin base (Icon.qml) defaultReelWidth: 67 // visualize depth > // . > >
Even as we county coral transfer “slotmachine” , we can range from the role. I point they in the middle of the view and establish this new default depth and you will peak to your points and you may reels. Once we don’t put a specific top for the symbols, the latest default viewpoints are used for all of them. When you struck play, this already research some a good. But at the a closer look, the fresh fixed height lets empty areas significantly more than otherwise underneath the slot server.
Let us correct that! Although we’re at they, we could as well as offer what you your by the addition of a handler into spinEnded laws and you can using this new startSlotMachine() function.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // put slot machine game FlaskOfRumMachine < id: slotMachine // we cardio it horzizontally and you will circulate it 10 px "under" the top bar // since the picture of the newest club casts a shadow on the towards the the brand new video slot anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we need the video slot so you're able to vehicle-proportions according to the readily available top // the slotmachine use the game window height except for the new topBar and you can bottomBar area // like with the big pub, the beds base bar as well as casts a trace with the to slot server height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // i upcoming calculate the fresh standard product level in accordance with the real slotmachine top and you will line number defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and alter the latest reel thickness to fit the object level (to keep up the brand new width/level ratio of the items) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // speed of twist is drop-off/increase together with goods top spinVelocity: Math.round(defaultItemHeight / 80 750) // connect rule in order to handler function onSpinEnded: scene.spinEnded() > // . // begin video slot function startSlotMachine() < if(!slotMachine.spinning && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // clean out player credit scene.creditAmount -= scene.betAmount // initiate host var stopInterval = utils.generateRandomValueBetween(five hundred, 1000) // between 500 and you may 1000 ms slotMachine.spin(stopInterval) > > // manage spin is finished rule function spinEnded() < bottomBar.startActive = false if(bottomBar.autoActive) startSlotMachine() > > >
So we circulate the fresh slot machine 10px right up so that the new topbar as well as the slotmachine convergence a while
I start with aligning the complete casino slot games underneath the ideal bar. However the topbar picture also includes a shade at the end. Given that finest bar is put on top of the slot server, it casts its shadow about it. An equivalent pertains to the base club. Just you to in this instance, new peak of the casino slot games is set accordingly to allow they convergence to the base bar.
Once form a dynamic level with the video slot considering the fresh new readily available place, we including calculate the latest thickness and you may peak of one’s symbols accordingly. And as the final step i including level new spin acceleration along with the item height. Whenever we don’t place a working way velocity, a video slot having quicker signs seems faster.
