• Advertisement

Archived

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

bltfast question

This topic is 6698 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

Guest Anonymous Poster
Looks like when you update xnew and ynew you should do xnew+=xvel instead. You should initialize xnew and ynew to the original position and get rid of dx and dy alltogether.

Share this post


Link to post
Share on other sites
Advertisement
Once you do get that baby moving, you'll need to do your own clipping or it won't move properly off of the edge of the screen.

Share this post


Link to post
Share on other sites

OK, I've been stuck for about 2 days now on what should be an easy thing to figure out. But I'm not getting it.

Suppose I have the following:

int dx; // represents the destination x
int dy; // represents the destination y

int xvel; // move x
int yvel; // move y

//global
int xnew = 0;
int ynew = 0;
============

dx = 100;
dy = 100;

xvel = 5;
yvel = 5;

xnew = dx + xvel;
ynew = dy + yvel;

lpddsback->BltFast(xnew,ynew, lpddsoff2, NULL, FALSE);

// shouldn't this update the location of the image with the new location? Assume the lpddsoff2 holds the image. Each time this is called doesn't the xnew,ynew hold the updated total of (X,Y)? I tried changing it to static, but isn't already static? What the heck am I doing wrong?


The way I have it figured it should run itself right off the screen after a couple of calls, but it doesn't move

------------------
Still Learning...

Share this post


Link to post
Share on other sites
Thanks. I did get it working and I set up borders around the screen except where I needed to be able to exit the screen. Its working great now though. Thanks again!

------------------
Still Learning...

Share this post


Link to post
Share on other sites

  • Advertisement