- modelData.kind of – has the icon term, age.grams. “rum”, “parrot”, “captain”, .
- modelData.regularity – holds brand new frequency value of the new symbol.
- modelData.investigation – comes with the custom user investigation of one’s symbol. We can use this to get into the image origin setup from our very own symbols.
The one that fills the casino slot games that have a back ground, an alternative shows light traces given that a boundary between the reels. This picture is put above the record additionally the created icons by the means the brand new z property.
Getting Everything To one another
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // complete online game window with history Rectangle < // . > // add casino slot games FlaskOfRumMachine < anchors.centerIn: mother or father defaultItemHeight: 80 // picture peak 70 + 5 margin most readily useful + 5 margin base (Icon.qml) defaultReelWidth: 67 // image width > // . > >
If we condition import “slotmachine” , we can are the parts. I point it in the world and you may establish this new default thickness and you will level https://captainspins.org/pt/ towards the activities and you will reels. Once we don’t lay a specific height in regards to our signs, the standard philosophy can be used for all of them. Once you strike play, which currently research somewhat an excellent. But within a closer look, the fresh repaired level allows empty elements above otherwise beneath the slot server.
Let’s genuine that! And while we’re from the it, we are able to and additionally provide everything your adding a great handler to the spinEnded signal and you will applying the fresh new startSlotMachine() form.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // put video slot FlaskOfRumMachine < id: slotMachine // we cardiovascular system it horzizontally and you can circulate it ten px "under" the big pub // because image of this new club casts a shade into with the the fresh new slot machine anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we truly need the slot machine so you can vehicle-proportions according to offered top // the fresh new slotmachine will use the video game window top except for the fresh new topBar and you may bottomBar town // like with the big bar, the bottom pub in addition to casts a shadow towards so you can position host height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // we up coming assess new default items level in line with the genuine slotmachine height and you may row number defaultItemHeight: Math.round(slotMachine.height / rowCount) // and alter brand new reel width to suit the thing height (to maintain brand new thickness/top ratio of the items) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // speed out-of twist is to drop-off/improve along with product height spinVelocity: Math.round(defaultItemHeight / 80 750) // hook signal so you're able to handler means onSpinEnded: scene.spinEnded() > // . // begin video slot function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // clean out player credit scene.creditAmount -= scene.betAmount // begin servers var stopInterval = utils.generateRandomValueBetween(five hundred, 1000) // anywhere between 500 and you may 1000 ms slotMachine.spin(stopInterval) > > // handle spin is finished signal function spinEnded() < bottomBar.startActive = untrue if(bottomBar.autoActive) startSlotMachine() > > >
So we move the fresh new slot machine 10px upwards to allow this new topbar additionally the slotmachine overlap sometime
I begin by straightening the complete video slot beneath the finest pub. However the topbar picture also incorporates a shadow at the bottom. Since better bar is put on top of the slot servers, it casts the trace about it. The same applies to the bottom club. Simply that in this instance, the newest level of the video slot is decided accordingly so that they overlap toward bottom bar.
Immediately after form an active height towards the slot machine based on the brand new offered area, i plus estimate the fresh new width and you can peak of your signs consequently. So that as the very last action i together with level the latest spin acceleration plus the product height. When we don’t place a working path velocity, a slot machine game with quicker signs would seem faster.
