[SOLVED] Change room by scrolling the screen rather than fade-in/fade-out?

Started by johanvepa, Sun 21/08/2016 21:40:29

Previous topic - Next topic

johanvepa

I remember the original Quest for Glory II had a nice feature where walking in the desert would cause the background to change by a quick sideways scroll from one screen to the other, rather than fading. This looked quite nice, I thought, and for backgrounds that fit nicely into each other without wanting the background to scroll as the players walk around, this is a nice touch to a game.

But how to do that?

Crimson Wizard

Firstly, you could try other built-in room transition effects, for example Dissolve or Crossfade, maybe that will work better for you than Fade-in/out.

Secondly, you could try making several "rooms" in one, if you call SetViewport to disable automatic camera scrolling. That will work if number of rooms is relatively low though, because you may run into room objects/areas limit.

Finally, as a more complicated solution, you could script this kind of transition yourself, if you create dynamic sprite with room background and objects in the room player is leaving, then create another dynamic sprite in the room player has entered, and display both sprite glued and moving (scrolling), for example, on a screen-sized GUI before player actually walks in.

johanvepa

I think perhaps the solution with the very large room and no scrolling may be what I'm looking for. It is a large labyrinthine game area with a lot of similar rooms. I was wondering how to make a function that carries across several rooms, too, and your room-of-many-rooms gives an excellent solution to that as well. Thank you.

Crimson Wizard

Quote from: Nanuaraq on Sun 21/08/2016 22:40:24I was wondering how to make a function that carries across several rooms
You could simply put such function in global script, or custom script module. You may need to use different parameters depending on room player is currently in, but that is all doable. For instance, you may setup some global variables in "Room load" event for each room.


johanvepa

Well actually I was thinking about a monster chase across several screens, and perhaps the easiest solution is the big room. Thank you for your help.

Danvzare

And just to add to the discussion, you could try to mix the cross fade with the big room idea.
You could have one room and it's surrounding rooms all in one room, and use SetViewport to stop the scrolling. And when you scroll to one of the adjacent rooms, you can then (after scrolling) cross fade to another set of nine rooms, where the room you just scrolled to is now in the middle..
It could be a useful idea if you do start to hit any limits. Although it might be a bit long winded and complicated to make.

SMF spam blocked by CleanTalk