I'm fairly new to C# and have mostly done Java. At the moment I am working on a project that has a spinning wheel and a spin button so its pretty simple. I've managed to get the wheel spinning it is currently 624 frames. i have set up a timer to handle the switch between images but as it spins its rather slow and i have interval set to 1 yet its still pretty slow takes about 10 secs to get through all 624 frames. i need it to be at least 4 secs for all 624 frames then gradually slow down.
here is some of my code below.
private void Spin_Click(object sender, EventArgs e)
{// button to start the timer
if (spin == 0) {
spin = 1;
Random r = new Random();
Console.WriteLine(r.Next(1, 53));
spin = 0;
st.Elapsed += new ElapsedEventHandler(OnTimedEvent);
st.Interval = 1;
st.Start();
}
}
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
t1 = t1 + 1;
Console.WriteLine("" + t1);
if (t1 == 1)
{
Wheel.Image = global::WheelOfFortune.Properties.Resources.Wheel_Test_0001;
}
else if (t1 == 2)
{
Wheel.Image = global::WheelOfFortune.Properties.Resources.Wheel_Test_0002;
} //etc x 624 then t1 = 0 to repeat
Any ideas would be great guys.
If you need further info let me know