Skip to main content
GameDev.net gamedev.net
🔒 Locked

scrolling efficiently

Started by loplop Apr 27, 2004 at 6:03 AM 8 replies 600+ views
Original Post
loplop
loplop
Im working on a game similar to broken sword 1 and 2. However, im stuck on trying to have a scrolling effect. If the user reaches the end of the screen, whats the most efficient way of making the screen scroll so that it looks like the user is walking? Ive got the image to automatically crop and only diplay whats on screen, but what should I do? thanks
Xtreme11
Xtreme11
well you can simply move the maps co-ordinates instead of the player and as you said crop out the rest that isnt being drawn. You can refine this further to create smooth scrolling based on a fine co-ordinate system. See this article:
Clicky
loplop
loplop
thanks for the reply. Since its a point and click game, how would i know how much to scroll the back ground by if the user isnt moving?
Xtreme11
Xtreme11
Might take a point of playing with to get it how you want but if you have already created the formula to move a character to the mouse click position, just move the map in the opposite direction instead of the player.
loplop
loplop
thats good idea. How would i know when the stop the map?
loplop
loplop
If I do that then how would i reset the position of the ''scroll lock'' object? For example, the user wants to move the left so that map scrolls to the right until the invisible object hits the player. What would I do if the user wants to move to the right even further? At the moment, the object is still hitting the player so it wont move. I think thats what you said in your post, but what would you recommend I do to overcome this problem? Thanks for the help, its a really good idea!
loplop
loplop
oh i see . so basically, the limit objects are off screen, but as soon as they come on, the screen stops scrolling. Once it stops, I just reposition the limit objects somewhere else off screen for later use? Sounds quite a simple, but effective idea. thanks!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.