Jump to content
  • Advertisement

Archived

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

jeffakew

360 degree scrolling smoothly?

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

Hello Could some please tell me how to get smooth scrolling in any direction. What I have now only scrolls smoothly left right up or down and I cant make it scroll smooth any other direction. This also happens with the sprites in my asteroid game. I''m using floats for everything yet it still jumps quite often when not going up, down, left or right. I know it can be done because there''s games on the Amiga which dont have this problem (such as Project Buzzbar). Any ideas or suggestions would be great thanks.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
U could get a basic effect by scrolling by a Horizontal and a verticle, I mean scrolling by(-10,20) will give a different angle to (5, 10), if u need to work it out from an angle a simple bit of tring should enable u to do so.

Share this post


Link to post
Share on other sites
I've had a lot of success keeping it to 40 directions. Why 40 and not 32? Well, that's what the original Direct Draw game used WAYYYY back in 1995! Don't re-write code that you can steal.

Look in the Donuts source code for something looking like:
double Dirx[40] = ...
and Diry[40]

These are X and Y offsets for moving in 40 directions. You can make your own, but you'll come up with these exact same values. Just scale them bigger or smaller to fit your needs.

BTW, please DO NOT calculate your angles on the fly...

xPos += sin(direction); // VERY SLOW
xPos += dirX[direction]; // VERY FAST

-Michael


Edited by - Buster on 5/1/00 3:30:10 PM

Share this post


Link to post
Share on other sites
Hmmm...I just made sin and cos look-up tables (0 to 359), and whenver the player changed direction, it jumped 5 degrees (+ or -, accordingly), and when they moved forward, i did the velocity calculations on the fly. It worked fine for me.

Share this post


Link to post
Share on other sites
For my asteroids game I took the look up tables from Space Boudha (cant remember how to spell it) game from the Inside DX book, it works well but there is that occasional unsmooth movement, which looks really bad when the whole screen is scrolling maybe its my PC. Oh well thanks for sugestions.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!