How do I remove the roofs on my top-down rpg?

0 favourites
  • 9 posts
From the Asset Store
Set of tiles to create a map for top-down games with island theme
  • Top-down 2d rpg... walking around visiting various buildings on the same level.

    However... i'd like to remain on the same level and simply 'remove' the roof as I walk into the building displaying the interior... then replace the roof on exit.

    Is there a convenient/efficient way to do this?

    Would the roof have to be a sprite on a higher layer? Or can it be somehow done with tiles etc?

    Or even revealed with a mask?

    There would be multiple buildings per level.

    Would love to hear your thoughts, thanks.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • One of the simplest ways would be to make it invisible while overlapping your player sprite, else visible.

  • Thanks for that... i guess that would involve making a sprite for each roof?

    Is there a more efficient way of using tiles etc?

    Will give it a go!

  • You can probably do something with the set tile range action.

    I imagine I would still use an invisible helper sprite to define the area of tiles to erase or replace and collide with. It could result in vram savings.

  • Thanks for replying...

    I Actually just made a quick demo, but the only way I can get it to work is:

    1.Getting the player to overlap an invisible helper (the size of the roof).

    2. Setting a tileset range to a transparent tile to make the roof tileset are transparent.

    Though this works, I can't find a way to match the co-ordinates of the invisible roof helperto the corresponding tiles x,y.

    I tried roof_helper.X and roof_helper.Y in the Set Tile X, Set Tile Y... but it's not looking for world co-ordinates, but tile co-ordinatess like 4, 8.

    I feel it would work well, but not practical to manually set every roof in the map.

    Any suggestions? Thanks

  • Thanks for replying...

    I Actually just made a quick demo, but the only way I can get it to work is:

    1.Getting the player to overlap an invisible helper (the size of the roof).

    2. Setting a tileset range to a transparent tile to make the roof tileset are transparent.

    Though this works, I can't find a way to match the co-ordinates of the invisible roof helperto the corresponding tiles x,y.

    I tried roof_helper.X and roof_helper.Y in the Set Tile X, Set Tile Y... but it's not looking for world co-ordinates, but tile co-ordinatess like 4, 8.

    I feel it would work well, but not practical to manually set every roof in the map.

    Any suggestions? Thanks

    look the examples to blends modes, there explain this and is too easy to make.

  • Top-down 2d rpg... walking around visiting various buildings on the same level.

    However... i'd like to remain on the same level and simply 'remove' the roof as I walk into the building displaying the interior... then replace the roof on exit.

    Is there a convenient/efficient way to do this?

    Would the roof have to be a sprite on a higher layer? Or can it be somehow done with tiles etc?

    Or even revealed with a mask?

    There would be multiple buildings per level.

    Would love to hear your thoughts, thanks.

    Like this:

    You should use blend modes. Create a Mask sprite - a black circle on a transparent background, you can make it with soft blurred edges if you want. Put the ceiling tilemap and the mask on a separate layer, set Force Own Texture=On on this layer. Set "Destination out" blend mode on the mask sprite. You can pin the mask sprite to your character.

    If you select File-New in Construct, there is an example project demonstrating different blend modes.

  • Excellent, thank you. I just implemented this and it seems to be working great!

  • Thanks for replying...

    I Actually just made a quick demo, but the only way I can get it to work is:

    1.Getting the player to overlap an invisible helper (the size of the roof).

    2. Setting a tileset range to a transparent tile to make the roof tileset are transparent.

    Though this works, I can't find a way to match the co-ordinates of the invisible roof helperto the corresponding tiles x,y.

    I tried roof_helper.X and roof_helper.Y in the Set Tile X, Set Tile Y... but it's not looking for world co-ordinates, but tile co-ordinatess like 4, 8.

    I feel it would work well, but not practical to manually set every roof in the map.

    Any suggestions? Thanks

    For future reference, you can convert world coordinates to tile coordinates and vice versa with Tilemap.PositionToTileX() and Tilemap.TileToPositionX()

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)