Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


bltfast question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 frizb   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 December 1999 - 12:36 PM


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...


Sponsor:

#2 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 15 December 1999 - 07:39 PM

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.

#3 blaze   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 December 1999 - 11:34 AM

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.

#4 frizb   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 December 1999 - 12:36 PM

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...





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS