How do I flip all of these objects in mass?

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hi Construct forums,

    I am making the collision for one of the tracks in my racing game, and it's a track with a layout that is perfectly symmetrical on both sides. I have finished making all of the collision for the first side, and I have been struggling to find a way to easily copy and paste the collisions to the other side.

    This is what the track looks like right now (the dark blue blocks are the collisions)

    I have tried using the "Wrap Selection" feature, but I am not able to get it to work. I think it's because all of the collision sprites have their origin points in the top left, making it hard to simply flip it with Wrap Selection.

    I have tried creating code using the "Mirrored" state, where it will mirror any collision that has a specific boolean instance variable set to True, but I also could not get that to work either.

    I'm pretty stumped with this one. I am willing to create some code that will automatically create the mirrored collisions on the other side if possible. If you have any questions, let me know, but also let me know if you're pretty sure if it's not possible.

    I obviously can still do it manually; it would just suck lol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can just create the mirrored side with events if you like:

    + System: On start of layout
    + System: For each Sprite
    -> System: Create object Sprite on layer 0 at (320-(Sprite(loopindex).X-320), Sprite(loopindex).Y), create hierarchy: False, template: ""
    -> Sprite: Set size to (Sprite(loopindex).Width, Sprite(loopindex).Height)
    -> Sprite: Set angle to 180-Sprite(loopindex).Angle degrees

    320 can be changed to whatever the center x position on the screen is.

    EDIT:

    Wait, you can just select all the sprites, press enter to wrap the selection and change the width to mirror it too.

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