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 / 2d fullscreen sprite scroll

Author
Message
Pyro_guy
21
Years of Service
User Offline
Joined: 10th Oct 2003
Location: England
Posted: 2nd Dec 2004 20:10
What is the best method of scrolling the whole screen through a 2d level, ie. in a 2d platformer game?

The way im using now keeps the character at the center of the screen by moving the level around him , not the actual character. So for example, if i wanted to move 5pixels to the right, i would move the whole level 5pixels to the left, making it appear as though the character is going right. I store the sprite numbers and positions in an array

Is this the best method of acomplishing this?

Screw the rules...what can i blow up?
TravisP
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location: Behind you, with a knife!
Posted: 3rd Dec 2004 02:43
Use 3d plains.

3D plains allow you to use camera commands and will speed it up.

Note: The above I didn't say, your just crazy.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 3rd Dec 2004 03:39 Edited at: 3rd Dec 2004 03:40
No.
Don't do that.
Use the method you were doing.

That's what I did for my competition entry, Tankoids and it worked great.

Have two variables, xCam and yCam and then whenever you make a sprite make sure you do this:

sprite 1, 100 -xCam, 200 -yCam, 1

Then just position the camera by changing xCam and yCam.

Login to post a reply

Server time is: 2024-11-13 18:52:54
Your offset time is: 2024-11-13 18:52:54