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.

DarkBASIC Professional Discussion / How do I keep center

Author
Message
Great Knight
23
Years of Service
User Offline
Joined: 25th Feb 2003
Location:
Posted: 3rd Jul 2003 06:30
I am wondering how do I always keep the screen center on one sprite. Because thats the only way I could think of making a 2d game with the screen changing as you walk.
AMD Atherlon 2400+ XP, 380 DDr memeory, ATI Radeon 9000 64 DDR.

And a Katana.
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 3rd Jul 2003 06:44 Edited at: 3rd Jul 2003 06:45
It's not that hard! Forgive me if it doesn't work; I wrote it off the top of my head.



"All programmers are playwrites and all computers are lousy actors" -Anon
Great Knight
23
Years of Service
User Offline
Joined: 25th Feb 2003
Location:
Posted: 3rd Jul 2003 07:29
Thxs, But I mean the sprite to change coordinates but the screen it self keep center on the sprite. And the code does not work well, but thanks.

AMD Atherlon 2400+ XP, 380 DDr memeory, ATI Radeon 9000 64 DDR.

And a Katana.
Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 3rd Jul 2003 10:40
You can scroll everything else when you walk by just moving their positions normally and then just always sprite to the center of the screen.

"Computers are useless they can only give you answers."
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 3rd Jul 2003 16:55
Yeah, you can't virtually scroll the screen. The screen has to remain centred, cos thats how 2D works. You'll have to simulate the screen scrolling, by keeping the character sprite central and moving everything else.

So if you want to move your sprite two pixels to the left, you leave it centred and move everything else 2 pixels to the right.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)

Login to post a reply

Server time is: 2026-07-17 13:57:41
Your offset time is: 2026-07-17 13:57:41