Jump to content
  • Advertisement


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


Smooth Scrolling, whats wrong here?

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

well, i''m trying to implement smooth scrolling, i.e. tiles move smoothly and not "jumping" so:
	int SmoothX, SmoothY;//this is how much to actually move the map

	SmoothY=dy%TILEHEIGHT; // grr, the problem

	int DeltaX, DeltaY;//this is how much whole tiles to change

	if (DeltaY%2) DeltaY++;// this is to fix a "snake prob" ill xpand later

	int ScreenX, ScreenY;
	for (int CountY=0;CountY<47;CountY++) {


		for (int CountX=0;CountX<12;CountX++) {
			if (CountY%2) {
			} else {
//i know, for future reference: logicalmapx=-DeltaX+CountX logicalmapy=-DeltaY+CountY

it work "smoothly" for the x axis, but for the y axis theres a "jumping" problem. i know its bcoz i fixed the snake prob, but dunno how to fix tha fix. i know how i sound, but its 4:44am here Gil p.s. snake prob: since my map isnt diamond, a column goes zigzag like staggered tilemaps (TANSTAAFL''s book abt isometrix). so this line is to fix a prob where the zigzag mirrors. p.p.s gotta get some sleep, plz help whoever reads so far and i''m not awake... i''m not making any sense now, am i?

Share this post

Link to post
Share on other sites
hmm.. methinks that ScreenY=(CountY*TILEHEIGHT); should be after the nested loop, not before. hope dat helps

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!