How do I rotate properly my game layout?

0 favourites
  • 9 posts
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • I'm trying to make a platformer with a gimmick where on a button press the entire layout (level) is rotate by 90 degrees.

    I achieved the rotation, but for some reason after the rotation the scroll to the player is not working correctly on newly rotate X axis, which is now replacing the old Y axis.

    So basically there's not vertical scrolling and I can't track the player on the screen anymore.

    Before rotation:

    After rotation:

    To rotate the level I'm doing this:

    also if you want to to have a look at the project itself here's the C3P file:

    https://drive.google.com/file/d/1KHpmhD_d-AUW5xzBMhEAgNf8Cv8kK7y-/view?usp=sharing

    PS: I started the project from an already existing example

    Any help will be highly appreciated and you will get lots of karma points for you life ^^

    Thank you!

    Tagged:

  • Hey there, I just have a question, is the player angle is supposed to look like it wasn't rotated with the layout? Just to be sure

  • uhm not sure I understood you question, but basically if I don't rotate the player I will not have the desired affect to also rotate the gravity along the layer rotation and this will happen

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's what I wanted to know ~ I'll try to give it a shot!

  • Much appreciated! Thanks ^^

  • Aight I found the culprit : the layout is not using Unbounded Scroll, as soon as you enable it, you'll see the new bottom of the stage after the rotation, but that also mean that you'll have to program an independant camera from the player and set the scrolling limits yourself

  • Ok great, for the "smart" camera I think I can work my way through, there's an example that does use a 9-patch object to impose the camera limits, maybe that will help.

    But thanks a lot again!

  • You can also use the clamp() expression, that prevent a value to go under or above a certain limit, for example clamp(Camera.X, 10, 100), the camera object's X position will never go under 10 or above 100, very useful to know for custom camera!

  • yep that's exactly what I will be using!

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