Lesson 20 help
Lesson 20 help
So I've been on this lesson for a good 4 hours about. Everything works perfectly aside aside from the fact that there is no animation occurring. It compiles and displays a still image on the screen as if there were no animation coding at all. I've watched the animation portion of the video countless times and I can't seem to figure out what I did wrong. It's not letting me attach any files though... It's not letting me attach a folder and it's giving me errors when I try to attach an individual file.
Re: Lesson 20 help
For some reason after you increment the frame number you've used the bitwise AND assignment operator on it with DUDENFRAMES, this resets it to 0 every frame.
You should be testing if its greater than or equal to the total number of frames and then reset to 0 if it is.
Code: Select all
void Game::Go()
{
frameNumber++;
frameNumber &= DUDENFRAMES; <--------HERE
gfx.BeginFrame();
ComposeFrame();
gfx.EndFrame();
}
Code: Select all
void Game::Go()
{
frameNumber++;
if( frameNumber >= DUDENFRAMES )
{
frameNumber = 0;
}
gfx.BeginFrame();
ComposeFrame();
gfx.EndFrame();
}
Musi
There are 10 types of people that understand binary.
Those that do, and those that don't.
There are 10 types of people that understand binary.
Those that do, and those that don't.
Re: Lesson 20 help
Thank you very much Musi for pointing that out for me. Really appreciate the help!
Re: Lesson 20 help
No problem
Musi
There are 10 types of people that understand binary.
Those that do, and those that don't.
There are 10 types of people that understand binary.
Those that do, and those that don't.