- modelData.type of – contains the symbol name, age.grams. “rum”, “parrot”, “captain”, .
- modelData.regularity – keeps the regularity worth of the fresh symbol.
- modelData.research – gets the customized user analysis of one’s symbol. We can use this to view the image resource configuration from our very own signs.
The one that fulfills the new slot turbonino online machine which have a back ground, a separate suggests white contours because a border within reels. Which image is put over the records and authored symbols by setting the z possessions.
Putting Everything Together
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // complete video game screen which have history Rectangle < // . > // incorporate casino slot games FlaskOfRumMachine < anchors.centerIn: mother or father defaultItemHeight: 80 // picture peak 70 + 5 margin top + 5 margin base (Icon.qml) defaultReelWidth: 67 // image width > // . > >
As we condition import “slotmachine” , we are able to are the parts. I anchor they in the middle of the world and you can identify the brand new default thickness and you will height on the activities and you can reels. While we failed to place a specific peak for the icons, this new standard values can be used for them. After you struck play, this currently lookup a bit a. However, at a closer look, new fixed peak lets empty parts over otherwise below the position host.
Let’s correct that! Although our company is at the it, we are able to plus give everything alive by the addition of a handler on the spinEnded code and implementing the brand new startSlotMachine() setting.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // put slot machine FlaskOfRumMachine < id: slotMachine // i cardio they horzizontally and you can move they ten px "under" the top club // given that image of the pub casts a shadow to your toward the fresh casino slot games anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we truly need the video slot to auto-proportions according to the readily available level // brand new slotmachine uses the online game windows height except for the topBar and you may bottomBar urban area // just as in the major pub, the beds base bar plus casts a shadow toward to position host height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // we after that calculate the fresh default item level in line with the genuine slotmachine top and you can row number defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and alter the reel depth to fit the item height (to maintain the latest width/level ratio of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // velocity regarding spin is to fall off/improve and goods height spinVelocity: Math.round(defaultItemHeight / 80 750) // connect signal to help you handler form onSpinEnded: scene.spinEnded() > // . // begin video slot function startSlotMachine() < if(!slotMachine.spinning && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // reduce player loans scene.creditAmount -= scene.betAmount // start host var stopInterval = utils.generateRandomValueBetween(five hundred, 1000) // between five-hundred and you may 1000 ms slotMachine.spin(stopInterval) > > // deal with twist is finished code function spinEnded() < bottomBar.startActive = not the case if(bottomBar.autoActive) startSlotMachine() > > >
So we circulate brand new slot machine 10px upwards to let the fresh new topbar together with slotmachine overlap a little while
I start with aligning the whole slot machine game below the better pub. Nevertheless the topbar photo also incorporates a shade at the bottom. As the most useful pub is placed on top of the slot machine, they casts the shade upon it. An equivalent pertains to the bottom club. Just one to in this situation, new level of one’s slot machine is decided correctly to let it overlap into base pub.
Just after setting a working level on slot machine game predicated on the new available area, we together with determine the brand new depth and you may height of your own icons correctly. And as the very last move we and additionally level the brand new spin acceleration also the product level. If we don’t lay an energetic direction speed, a video slot which have reduced icons seems smaller.