- modelData.variety of – has the icon title, e.g. “rum”, “parrot”, “captain”, .
- modelData.frequency – retains the fresh volume property value the newest symbol.
- modelData.studies – has the individualized representative study of one’s symbol. We are able to utilize this to access the image origin setup regarding our symbols.
One which fulfills the new video slot that have a background, a new shows light outlines just like the a line involving the reels. Which visualize is placed over the history while the created icons by the means brand new z property.
Getting What you To each other
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // fill video game screen that have background Rectangle < // . > // incorporate slot machine FlaskOfRumMachine < anchors.centerIn: moms and dad defaultItemHeight: 80 // visualize level 70 + 5 margin best + 5 margin base (Symbol.qml) defaultReelWidth: 67 // photo thickness > // . > >
If we state transfer “slotmachine” , we can range from the role. We anchor it in the view and you may specify the new cassino dragonbet online default thickness and you may height to your factors and reels. Once we failed to lay a specific top for our symbols, the latest standard philosophy can be used for them. When you strike play, this currently browse somewhat an effective. However, from the a close look, new repaired height allows blank portion a lot more than otherwise beneath the slot server.
Let’s correct that! And even though we’re at they, we are able to including provide everything your by adding a handler into spinEnded signal and you may applying new startSlotMachine() form.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // include slot machine FlaskOfRumMachine < id: slotMachine // i center they horzizontally and you may move they ten px "under" the big pub // since the image of the fresh bar casts a trace to the into the brand new slot machine anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we want the latest video slot in order to vehicles-size with regards to the available peak // the new slotmachine use the video game windows level except for the brand new topBar and you will bottomBar area // just as in the big bar, the bottom club plus casts a shadow with the to slot host height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // i following calculate brand new standard item height based on the actual slotmachine peak and you may line number defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and change the newest reel thickness to complement the object level (to maintain the fresh new width/level ratio of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // velocity out-of spin will be decrease/improve in addition to goods level spinVelocity: Math.round(defaultItemHeight / 80 750) // hook laws in order to handler mode onSpinEnded: scene.spinEnded() > // . // start video slot function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // reduce player credits scene.creditAmount -= scene.betAmount // initiate servers var stopInterval = utils.generateRandomValueBetween(five-hundred, 1000) // between five hundred and you may 1000 ms slotMachine.spin(stopInterval) > > // handle spin is finished signal function spinEnded() < bottomBar.startActive = false if(bottomBar.autoActive) startSlotMachine() > > >
Therefore we circulate brand new video slot 10px upwards to let the fresh topbar together with slotmachine overlap sometime
We start with aligning the whole video slot underneath the finest club. However the topbar image also incorporates a shade in the bottom. Given that better pub is positioned in addition position server, it casts its shadow on it. An equivalent relates to the bottom club. Only one to in cases like this, new level of one’s video slot is determined consequently to allow they overlap into base bar.
Immediately following mode an energetic peak on the slot machine game centered on the fresh new offered room, i together with determine the fresh width and you will level of your signs correctly. So when the very last move i in addition to scale the brand new spin speed as well as the items top. When we don’t put an active path acceleration, a slot machine game that have smaller signs would seem faster.
