Hi,
I would like to speed up game station theme. The current script is original running num_arts = 10. How to update as below script to work on "exactly" num_arts = 5 instead of 10? I think it is effect the performace. Thanks.
My ideal code should be :
local wheel_x = [ flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822,];
local wheel_y = [ 0, fly*-0.08, fly*0.152,, fly*0.384, fly*0.616 ];
local wheel_w = [ flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, ];
local wheel_a = [ 205, 205, 255, 205, 205,];
local wheel_h = [ flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, ];
local wheel_r = [ 0, 0, 0, 0, 0, ];
local num_arts = 5;
{
fe.load_module( "conveyor" );
local wheel_x = [ flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822, flx*0.822, ];
local wheel_y = [ 0, fly*-0.08, 0, fly*0.152, 0, fly*0.384, 0, fly*0.616, 0, fly*0.848, 0, 0, ];
local wheel_w = [ flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, flw*0.179, ];
local wheel_a = [ 0, 205, 0, 205, 0, 255, 0, 205, 0, 205, 0, 0, ];
local wheel_h = [ flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, flh*0.23, ];
local wheel_r = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
local num_arts = 5;
class WheelEntry extends ConveyorSlot
{
constructor()
{
base.constructor( ::fe.add_artwork( my_config["orbit_art"] ) );
}
function on_progress( progress, var )
{
local p = progress / 0.1;
local slot = p.tointeger();
p -= slot;
slot++;
if ( slot < 0 ) slot=0;
if ( slot >= 10 ) slot=10;
m_obj.x = wheel_x[slot] + p * ( wheel_x[slot+1] - wheel_x[slot] );
m_obj.y = wheel_y[slot] + p * ( wheel_y[slot+1] - wheel_y[slot] );
m_obj.width = wheel_w[slot] + p * ( wheel_w[slot+1] - wheel_w[slot] );
m_obj.height = wheel_h[slot] + p * ( wheel_h[slot+1] - wheel_h[slot] );
m_obj.rotation = wheel_r[slot] + p * ( wheel_r[slot+1] - wheel_r[slot] );
m_obj.alpha = wheel_a[slot] + p * ( wheel_a[slot+1] - wheel_a[slot] );
m_obj.video_flags = Vid.NoAudio;
}
};
local wheel_entries = [];
for ( local i=0; i<num_arts/2; i++ )
wheel_entries.push( WheelEntry() );
local remaining = num_arts - wheel_entries.len();
// we do it this way so that the last wheelentry created is the middle one showing the current
// selection (putting it at the top of the draw order)
for ( local i=0; i<remaining; i++ )
wheel_entries.insert( num_arts/2, WheelEntry() );