Which one of this options it's better for the tilemap of my game?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Gonz4 L

When you press certain buttons in my game, the tilemap is flipped horizontally or vertically (however the player, enemies and objects remain the same).
Which option is better?
1 - Flip the entire Node2D (using scale -1 and position 1920, 1080), activate the sprites flip_h, flip_v or both properties and inmediately move them down until they get to the floor or original x (i’ve no idea how to make it work horizontally…).
2 - Make different tilemaps for each situation, disable and activate them and move the entities until the nearest free space is reached (first up or down depending on the center of the player, if not, then right or left).
3 - Flip only the tilemap and move the characters and objects like in the second one (but i don’t know how to setup the camera to be always centered). The problem with this one is that scale -1 flips the screen, i.e, over the origin point (this also could be done in the second one).
Or
4 - Do the third one but lowering the flipped tilemap (using position (1920, 1080) ) (this too i don’t know how to do it because the non-flipped things coordinates doesn’t fit with the tilemap ones).

the tilemap (but character and maybe enemies and objects) is flipped horizontal or vertically.

is this a typo?

Could you further explain the effect you are trying to get? What’s the purpose of flipping the tilemap and character?

Millard | 2020-09-22 01:09

Hi! Only the tilemap is flipped because then you can obtain objects originally out of your range, avoid enemies (if i decide to make them flip too), get to the room’s exit (my game is based on them), etc. That’s why i want to know which is the most efficient option.

Gonz4 L | 2020-09-22 03:38

Cool game mechanic. I don’t know that much about tile maps, but I think i would try using the node 2d and scaling it to -1, but why do you need to set the position to 1920, 1080?

you might even be able to animate the scaling and get a cool animation, however that might not be what you’re going for.

Millard | 2020-09-22 15:30

also, you could word the question like this to make it more clear:

when you press certain buttons in my game, the tilemap is flipped horizontally or vertically (however the player, enemies and objects remain the same).
Which option is better…

Millard | 2020-09-22 18:02

The description is fixed now.

Gonz4 L | 2020-09-22 22:24

I said that before realizing that i could make the origin be at the center of the screen. But still my problem with that option are the x coordinates because the character goes to the other side of the screen when what i want is to keep its original position.

Gonz4 L | 2020-09-22 22:43