bltfast question
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.
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.
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...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement