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 / Moving Sprite in RPG-like context

Author
Message
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 18th Sep 2005 14:06
In an top-down 2d rpg like Final Fantasy I, which would be better, moving the sprite, or keeping the sprite in the center of the background with the background moving?
I mean, moving the sprites positives are:
Easy Coding of Interactive background, e.g.

But its downsides are constricted viewing, unless if you went of the screen, it went to another map.

But then their is moving the background while keeping the sprite in the center.

Positives:
Large viewing area

Negatives:
I have no Idea how you would code an interactive background with the background moving all over the place. You couldnt say

because at one point sprite1xpos may be on a door, but two seconds later it may be on a car, or a brick, or a walrus with a top hat.

So... Which is preferable?

Note: I ask, not because I wish to make an rpg as may prove impossible for one of my limited (when I say limited, I mean as proficient as a brick) DarkBASIC skills, but for the sake of asking.

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Sep 2005 20:10
That's why we use arrays to store the map data. That way detecting things on the map will work weither or not you want the character to stay in the center or move around the current screen.

dim Map(99,99) <-(a 100x100 map grid)
Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 18th Sep 2005 20:25
use this code

don't change anything apart from the sprite number
hope this helps

New game about to be unleashed steal un theif
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Sep 2005 07:06
"_BOUNDARY_CHECKS" is the subroutine you should look at to see how I kept the player in the center, unless its near the edge where the map can't scroll any further.




Deadly Night Assassins
Fneep
19
Years of Service
User Offline
Joined: 3rd Sep 2005
Location: In my house
Posted: 19th Sep 2005 07:56 Edited at: 19th Sep 2005 07:59
~Darkbasic MAD

Thanx, That code really helped me to understand how it would work.

~Phaelax

Yeah, thanx, I was wondering how you would tell if theyre was no more background to scroll. Would putting the edge of the map into a variable work? Like, the edge of the scrolling background is x=45. Then you could go summin' like:



Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 20th Sep 2005 17:58 Edited at: 20th Sep 2005 18:00
I've got a whole tutorial on sprites if you need more help

http://forum.thegamecreators.com/?m=forum_view&t=60785&b=1

New game about to be unleashed steal un theif

Login to post a reply

Server time is: 2024-09-24 05:27:50
Your offset time is: 2024-09-24 05:27:50