Hello Guest

Author Topic: best way to go about making a large scrolling map like final fantasy or zelda...  (Read 5774 times)

juntaou

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
So that question is a little vague, let me expound.

I just got this 2d toolkit and have started playing around with it. I'm still learning the basics with it, but I wanted to know what the best way would be to create a game like a final fantasy or zelda. I finally have tile maps displaying correctly, which wasn't hard but I had a lot of user errors to work through :D. I haven't gotten collisions working between sprites and tile maps yet, but I'm sure that will come as well.

The real question I'm working on now is how do I make a large scrolling map. I'm using tk2dCamera which automatically puts my character at the correct x and y coordinates, my question then is what should I be scrolling. My hero will always be centered on the screen, so should I scroll the world objects, like bad guys, the world tile maps, etc... Should I keep all that stationary and move the camera with hero(if I do that how will it impact placing new characters?). I've played around with it, but haven't been able to get to to look or feel right. Anyone have any thoughts about best practices for this?

 

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
I'd suggest keeping the world static and moving the character. Attach the camera to the character, and the character will always be at the correct location.

Hierarchy view
Main Character
    Main Camera
TileMap
OtherCharacters

By keeping the world static, you know that 10,10 will always be the same location on the world map - makes placing and moving things SO much easier.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
p.s. The hierarchy shown (Main Char -> Main Camera) is purely to illustrate the concept. Sure you could ship with it set up like that, but you could just as easily keep them separate, and have a monobehaviour smoothly follow the player so it looks like the camera's chasing the player.

mike2d

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 63
    • View Profile
interesting,

can you give me an example of such a script (smooth follows player) ?