Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Once again... continous scrolling

Author
Message
Dextro
19
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 4th Sep 2007 02:43 Edited at: 5th Sep 2007 06:24
Hello.
I have been trying to get smooth, continous scrolling for a tile engine for the past year or so, but to no avail.
I asked here in the forums, and I got a function from kevin picone that copies a temporary array onto the map array, so it scrolls continously.
Somehow, it seems that it is scrolling smoothly, but when you run the code and walk, you'll see that a block passes by completely and very fast, thus it's not a smooth, pixel scrolling.
I'm only using 1 layer for the map, so it's not parallax scrolling.
Here's the code:


By the way, the images are 32*32.

Edit:
Could a Mod please move this to Pro discussion?
Here's a XNA version of the source.

Attachments

Login to view attachments
HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 7th Sep 2007 03:28
This might help you.


http://forum.thegamecreators.com/?m=forum_view&t=105905&b=6

Better to be dead, than to live your life afraid.
Dextro
19
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 13th Sep 2007 07:00 Edited at: 13th Sep 2007 07:02
Ok, I came up with this code, does the job flawlessly, but I'm sure it's not the best way to achieve it.
This might be interesting for those who like to play with 2d and tile based maps, and everyone in general as I think this might be useful in 3d apps as well.

By the way, the media consists of 3 images of 32*32 pixels each, and an image of 32*64.

Login to post a reply

Server time is: 2024-09-27 05:12:59
Your offset time is: 2024-09-27 05:12:59