it goes too fast.
Code: Select all
// draw faster flying imp
driver->draw2DImage(images, core::position2d<s32>(240,240),
Test_Sprite(35), 0, video::SColor(255,255,255,255), true);
calls the function Test_Sprite passing the paramenter 35 (for the speed, its basically how many frames to wait until it changes the frame to another simulating animation)
Code: Select all
core::rect<s32> Game_Main::Test_Sprite(int counter_speed)
{
framecounter += 1;
if(framecounter == counter_speed)
{
//do stuff
framecounter = 0;
if (frameholder = maxframes)
{
frameholder = 0;
}
else
{
frameholder += 1;
}
return frames[1];
}
else
{
return frames[0];
}
};
also i had the change the return value to 1 and 0 it used to be a variable but for some reason it seemed to not work it would return the value + 1, so i changed it temporarily to see if the animation timing system, which i want to work based on FPS would work.
problem is, it goes to fast.
is there a way to control the speed and make go (var) speed on all computers not going faster or slower on better comps?