Archived

This topic is now archived and is closed to further replies.

ANyone want to help me out with this tidbit of code?

This topic is 6365 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is supposed to make it so when the person calls the Intro function that the bitmap will scroll across the screen its not working and I cant figure out why. What it does is it shows the bitmap and it stays stuck there any help id appreciate it. #include "intro.h" // Setting the values to the classes private variables. Intro::Intro(void) { Intro::x = 0; Intro::y = 0; Intro::x1 = 480; Intro::y1 = 220; Intro::xy = true; } void Intro::scroll(LPDIRECTDRAW7 lpdd, LPDIRECTDRAWSURFACE7lpdd7) { // Loads bitmap wraper I wrote ^_^ first.loadBmp("cheese.bmp", lpdd); // Draws the bitmap on screen the x and the y are // Where to load it first.drawBmp(lpdd7, x,y); // Loads bitmap wraper I wrote ^_^ second.loadBmp("running1.bmp", lpdd); // Draws the bitmap on screen the x and the y are // Where to load it second.drawBmp(lpdd7, x1, y1); while (xy == true) { x1 -= 1; if ( x1 == 240) { xy = false; } } } When I test it in the test cpp it just stays at the initial position of where I load the bitmap. This is driving me crazy!

Share this post


Link to post
Share on other sites
Shouldn't the line:

quote:

second.drawBmp(lpdd7, x1, y1);



be inside the while loop if you want it to move?
As far as I can tell you draw it in the initial position and then loop through the next positions to draw but don't actually draw it.

Laters

Edited by - poontardis on July 14, 2000 4:11:53 AM

Share this post


Link to post
Share on other sites