- modelData.method of – has got the symbol name, e.g. «rum», «parrot», «captain», .
- modelData.regularity – holds the fresh new frequency worth of new icon.
- modelData.analysis – has the customized representative data of one’s symbol. We can use this to view the image provider setting regarding the signs.
The one that fills new casino slot games which have a back ground, a new suggests light traces since the a boundary involving the reels. This image is placed above the history together with created icons because of the mode new z assets.
Placing Everything you To one another
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // fill online game windows which have record Rectangle < // . > // put casino slot games FlaskOfRumMachine < anchors.centerIn: father or mother defaultItemHeight: 80 // photo peak 70 + 5 margin most readily useful + 5 margin base (Icon.qml) defaultReelWidth: 67 // visualize thickness > // . > >
As we county transfer «slotmachine» , we can are the role. We point they in the exact middle of the world and you may specify the new standard depth and have a peek at these guys you can level on the affairs and you can reels. Even as we did not set a certain peak for the symbols, brand new default philosophy are used for all of them. Once you struck play, this already browse slightly a great. But on a close look, the newest repaired top allows blank portion significantly more than or below the position host.
Let’s correct that! And even though the audience is at the it, we could plus bring what you to life by the addition of a handler for the spinEnded laws and you may implementing the startSlotMachine() setting.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // add casino slot games FlaskOfRumMachine < id: slotMachine // we cardiovascular system it horzizontally and you may flow they ten px "under" the big club // once the image of the fresh new club casts a shade on to your brand new slot machine game anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we require the fresh slot machine to car-size depending on the offered height // the newest slotmachine will use the game window peak with the exception of the fresh new topBar and bottomBar town // just as in the top bar, the beds base pub plus casts a shade on the so you can slot machine height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // we next estimate brand new standard items level in line with the actual slotmachine top and you can line matter defaultItemHeight: Mathematics.round(slotMachine.height / rowCount) // and change brand new reel width to complement the item peak (to maintain this new width/top proportion of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // speed of twist will be drop-off/boost as well as items peak spinVelocity: Math.round(defaultItemHeight / 80 750) // connect laws to handler form onSpinEnded: scene.spinEnded() > // . // start slot machine game function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // cure athlete loans scene.creditAmount -= scene.betAmount // begin machine var stopInterval = utils.generateRandomValueBetween(five hundred, 1000) // between 500 and you will 1000 ms slotMachine.spin(stopInterval) > > // manage twist is fully gone signal function spinEnded() < bottomBar.startActive = not true if(bottomBar.autoActive) startSlotMachine() > > >
Therefore we disperse the fresh slot machine game 10px upwards to let brand new topbar additionally the slotmachine convergence a bit
I start with straightening the entire slot machine below the best pub. Although topbar image also includes a trace towards the bottom. Given that ideal bar is placed in addition slot host, they casts its shade onto it. The same applies to the beds base bar. Just you to in this situation, this new height of slot machine game is set properly to let they overlap into the base pub.
After means a working level with the casino slot games based on the newest available area, i as well as calculate the brand new depth and you may level of one’s signs properly. And also as the past step we and additionally measure new spin velocity plus the item level. If we did not put a dynamic course speed, a slot machine game which have less signs would seem smaller.