Lesson 20 help

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Renthal97
Posts: 29
Joined: December 23rd, 2012, 11:16 pm

Lesson 20 help

Post by Renthal97 » December 28th, 2012, 3:23 am

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.

Renthal97
Posts: 29
Joined: December 23rd, 2012, 11:16 pm

Re: Lesson 20 help

Post by Renthal97 » December 28th, 2012, 3:31 am

Got the zip file up.
Attachments
Sprites.zip
(74.58 KiB) Downloaded 162 times

Musi
Posts: 106
Joined: November 25th, 2012, 1:06 am

Re: Lesson 20 help

Post by Musi » December 28th, 2012, 1:02 pm

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.

Code: Select all

void Game::Go()
{
	frameNumber++;
	frameNumber &= DUDENFRAMES; <--------HERE
	gfx.BeginFrame();
	ComposeFrame();
	gfx.EndFrame();
}
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++;
	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.

Renthal97
Posts: 29
Joined: December 23rd, 2012, 11:16 pm

Re: Lesson 20 help

Post by Renthal97 » December 29th, 2012, 3:41 am

Thank you very much Musi for pointing that out for me. Really appreciate the help!

Musi
Posts: 106
Joined: November 25th, 2012, 1:06 am

Re: Lesson 20 help

Post by Musi » December 29th, 2012, 12:41 pm

No problem :D
Musi

There are 10 types of people that understand binary.
Those that do, and those that don't.

Post Reply