I have developed a slot machine in Phaser 3. The reels are essentially tile sprites that rotate during spinning.
When the reels slow down, I would like to load a tile sprite of symbols representing the outcome of the payout engine.
Since I can't load a tile sprite representing the entire reel (each physical reel would contain more than 100 images), the below code I have developed needs to be modified so that instead of loading "symbols", it loads a tile sprite containing predetermined images.
function spin_end(obj){
//stop obj tilesprite at stop position
obj.y = get_stop('start', obj.id);
obj.setTexture('symbols');
//it should be changed in obj.setTexture('results') how can i create results???
self.tweens.add({
targets: obj,
y: get_stop('end', obj.id),
duration: 800,
ease: 'Back.easeOut',
onComplete(){
if(obj.id === 4){
calculate();
is_spinning = false;
}
}
});
setTimeout(()=>{
play_sound('Slot Machine Stop '+Number(obj.id+1), self);
}, 400);
}