Log In  

So, I'm going for some modular map usage, and in the interest of map management, I need to learn of a way to make "scroll cuts" and "jump cuts" between segments. For instance, the "Concert of the Damned" map is broken up into pathways that exit to the left and right, and the top and bottom. The "green blocks" indicate doorways that will jump the character into the next scene upon collision. But don't let the layout fool you! Since the map is modular, each of these scenes doesn't just connect to it's neighbor, they're designed to cross-script to one another. 200x on the other hand, scripts gameplay mechanics into the segments and warps between them, but I also need to preserve the scrolling within each scene, while not scrolling to the other scenes in visible range (perpindicularly). The screenshot for it shows horizontal corridors, but I have a section of vertical ones as well; so it's not just as simple as only scrolling on the X-axis.

What I need is a way to cut the scrolling at the ends of the screens, and jump-cut to another segment of the map; while preserving the scrolling in the segments themselves. Any code monkeys care to give me a little tutorial on that?

P#35184 2017-01-07 17:22 ( Edited 2017-01-12 07:32)

A code noob here.

While I can't provide a code solution of what you need, I have a different idea. What if you either stop draw update or fade to black (draw 128x128 black square on top of everything) while the game scrolls to the new coordinates?

Once the camera reached the new coordinates, just delete the square or resume _draw.

edit: you can also just stop the camera function from scrolling.

P#35216 2017-01-08 00:58 ( Edited 2017-01-08 06:01)

^ That would be a jump cut, yes. I'm just not certain how to do that in LUA/PICOcode yet. A "scroll cut" would be like LoZ, where you hit the side of the screen, and it does a transitional scrolling to the next scene.

P#35240 2017-01-08 08:03 ( Edited 2017-01-08 13:03)

Check out noel's 'Exploration' on the WIP forums, I think it might have some useful stuff in it for your purposes
Here

Basically, instead of moving the camera along the map, it keeps the camera still and draws only a segment of the map (for the 'room' you are in), changing room to the next map section when the player leaves the bounds of the 'room' object (x,y,w,h)

Not sure if it solves all your problems, but it might be a place to start.

Another thought, you could try making a table of 'rooms' with X,Y,W,H properties mapped to the tile coordinates of the map, manually determining where each room began and ended.

For instance, say you have

--Map of rooms, including two long rooms that both connect to a tall room
room_map = {
  hallway={ 0, 0,32,16},
  tower={32, 0, 16,32),
  basement={ 0,16,32,16)
}

--Start in one of the rooms
function _init()
  room = room_map.hallway
end

--Draw only the current room
function _draw()
  map(room.x,room.y,0,0,room.w,room.h)
end

--See if the player has left the room
function _update()
  if player.x < 0 then
    --change room Left
  elseif player.x > room.w*8 then
    --change room Right
  --etc for Up and Down
end

function change_room()
  --Do some collision-check-style code to set 'room' to the new item in 'room_map'
  --Add any conditions for special teleport-like areas
  --Wrap the player location around to the correct position based on which way he exited
  --Make a room transition effect
end

...or something like that, sorry I didn't test the pseudo-code myself

Bonus points for using the room_map table to make a Castlevania-style minimap

P#35514 2017-01-12 02:32 ( Edited 2017-01-12 07:32)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 18:24:14 | 0.006s | Q:14