One which fills the fresh video slot which have a background, a special reveals light outlines since a boundary within reels. So it picture is put over the record plus the composed signs by mode the new z possessions.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . World < // . // complete online game screen which have record Rectangle < // . > // include video slot FlaskOfRumMachine < anchors.centerIn: father or mother defaultItemHeight: 80 // picture level 70 + 5 margin greatest + 5 margin base (Icon.qml) defaultReelWidth: 67 // image depth > // . > >
After we county transfer “slotmachine” , we can are the component. I point they in the center of the view and specify the fresh standard thickness and you can top on affairs and you can reels. While we didn’t put a certain top for the palaces online our signs, the fresh default values are used for all of them. After you struck enjoy, it currently research somewhat an effective. However, at a closer look, this new fixed top lets blank parts over otherwise beneath the slot machine.
Let us correct that! Although we’re within it, we are able to plus promote what you your with the addition of a beneficial handler with the spinEnded laws and you will implementing the fresh startSlotMachine() means.
import Felgo 4.0 import QtQuick 2.0 import "slotmachine" GameWindow < // . Scene < // . // incorporate slot machine game FlaskOfRumMachine < id: slotMachine // we cardiovascular system it horzizontally and flow they ten px "under" the major bar // due to the fact picture of the latest club casts a shadow into into the the slot machine game anchors.horizontalCenter: scene.horizontalCenter anchors: topBar.bottom anchors.topMargin: -10 // we require the casino slot games so you can vehicles-size according to the offered peak // the newest slotmachine use the game window top apart from the new topBar and bottomBar urban area // just as in the major bar, the beds base bar as well as casts a trace to the to slot server height: scene.gameWindowAnchorItem.height - (topBar.+ anchors.topMargin) - (bottomBar.height 10) // we next assess brand new standard item height in line with the genuine slotmachine level and you can row number defaultItemHeight: Math.round(slotMachine.height / rowCount) // and alter the reel thickness to suit the item level (to keep the new depth/peak ratio of the things that) defaultReelWidth: Math.round(defaultItemHeight / 80 67) // velocity of twist is always to drop-off/raise in addition to item peak spinVelocity: Math.round(defaultItemHeight / 80 750) // connect laws so you can handler setting onSpinEnded: scene.spinEnded() > // . // initiate casino slot games function startSlotMachine() < if(!slotMachine.rotating && scene.creditAmount scene.betAmount) < bottomBar.startActive = true // eliminate player loans scene.creditAmount -= scene.betAmount // start servers var stopInterval = utils.generateRandomValueBetween(500, 1000) // between five hundred and you will 1000 ms slotMachine.spin(stopInterval) > > // deal with twist is finished laws function spinEnded() < bottomBar.startActive = false if(bottomBar.autoActive) startSlotMachine() > > >
We start with aligning the complete casino slot games below the most useful club. But the topbar photo also incorporates a shade in the bottom. Because ideal bar is placed in addition position server, it casts the shade onto it. A comparable pertains to the base pub. Just you to definitely in such a case, the peak of your own casino slot games is set correctly so that it overlap towards the bottom club.
After mode a working level towards casino slot games centered on the fresh available space, we and additionally assess the fresh new width and you can peak of your signs consequently. And also as the last move i and additionally size new spin velocity plus the goods height. When we did not put an active movement speed, a video slot that have quicker signs seems smaller.