forums

TNT Basic Forums > Programming Q&A
Problem with scrolling
< Last Thread     Next Thread >
Author
Thread        Post A Reply

12-09-2001 22:36

Posted by:
Jase

Click Here to Email Jase   Find more posts by Jase

I'm sorta new to pogramming. And i need some help with something.
You know how in some games you'll move the player around and then when it gets too close to the edge of the screen, the screen will scroll across in that direction. Well, i can't figure out how to do it.
Please help me.

12-20-2001 17:26

Posted by:
Jon

Click Here to Email Jon   Find more posts by Jon

Re: Problem with Scrolling

What I do is have 3 sets of coordinates. The first describes the player's position on the screen. The second describes the map offset (or how many pixels over the screen has scrolled). And the third is the player's position in the level.

The only one I set is the 3rd one, the other two are then calculated using the player's position in the level. Using this scheme makes it easy to change how the scrolling works later.

There are many different ways to scroll, but my favorite is to keep the player in the center unless he gets close to the ends. In that case, you stop scrolling and move the player.

Hope that helps,
Jon

P.S. I have code if you want

12-22-2001 04:54

Posted by:
Jase

Find more posts by Jase

Yeah, code would be a big help

12-28-2001 16:31

Posted by:
Douglas O'Brien

Click Here to Email Douglas O'Brien   Find more posts by Douglas O'Brien

Slow Scrolling

I guess the fastest way to scroll in TNT is to use the view port method in the scrolling example codes, but that runs pretty slow. In things like C or other languages, scrolling is quite a bit faster. TNT does interpret, but mabey it has to do with the the view port stuff. In other languages you can make the canvas that you draw to the screen from any size, and that might help. I dunno.

12-28-2001 16:32

Posted by:
Douglas O'Brien

Click Here to Email Douglas O'Brien   Find more posts by Douglas O'Brien

Slow Scrolling

I guess the fastest way to scroll in TNT is to use the view port method in the scrolling example codes, but that runs pretty slow. In things like C or other languages, scrolling is quite a bit faster. TNT does interpret, but mabey it has to do with the the view port stuff. In other languages you can make the canvas that you draw to the screen from any size, and that might help. I dunno.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.