How do I support both Orientations?

0 favourites
  • 12 posts
From the Asset Store
Comprehensive localization solution for Construct 3 projects, no addons required!
  • Hi,

    After running into several problems trying to make my own very first game, I decided to go back to the basics and now an working through any and all tutorials I that might have something to do with my game. I just finished a really good Match-3 game on Tutsplus - very detailed and informative.

    Now, I am thinking, is it possible to make a Match-3 game possible in both orientations simultaneously? That is, what happens when the player rotates his device mid-play?

    The GUI elements won't be that difficult to handle, I think. But what about the individual balls. How to make sure that they end up in the right position when the device is rotated?

    Any and all help will be very appreciated.

  • You shouldn't need to do anything at all. Just use letterbox scale mode and the game will automatically scale accordingly when changing orientation.

  • Thanks for your reply. But with using Letterbox, isn't there a chance of black bars appearing down the sides, when the aspect ratio of the device is different from the one I designed my game with?

  • Bumping the thread in the hope that someone might have the answer I'm looking for.

  • Yes, you get black bars. If you don't want them, choose 'scale outer' or 'scale inner' instead, but now your game has to work with different aspect ratios which is trickier to design. The 'supporting multiple screen sizes' tutorial covers this.

  • Thank you so much for your reply.

    My plan is to design for 480x320 (landscape mode) and make the background big enough to account for the other aspect ratios using scale outer. Further, I plan to place the GUI elements (score, lives and other stuff) by using Anchor. The individual balls are placed placed in a grid, separated by a certain distance from each other.

    My problem is I am not sure of what happens when the mobile device is rotated and the screen becomes 320x480. How are the balls affected? What do I have to do to make sure that they end up in the equivalent position when the device is rotated and the game continues uninterrupted?

  • I'm guessing you probably want to do something like Candy Crush Saga does. No matter which orientation you have, the game looks good. It switches around HUD parts based upon landscape or portrait.

  • - "I'm guessing you probably want to do something like Candy Crush Saga does."

    I am actually following a tutorial I found on Tutsplus by David Silverman. I finished it and then I did think of Candy Crush and how those types of games work in any orientation. So I am wondering how it would work here.

    " It switches around HUD parts based upon landscape or portrait. "

    Are you saying that if I design for landscape mode, the portrait mode will take care of itself? Could you elaborate a bit - this part isn't not clear to me. I am just not getting how the balls will land up in the right place when the device is rotated.

  • d5s - well, I could be wrong since I haven't played Candy Crush Saga in a long time, but doesn't the main candy area never move when flipping between landscape and portrait? I think only the HUD and other things move around it to new positions. So, the game area (the match 3 candies part) is a static size.

    Using Intel XDK object, you can use action "Compare Orientation" to then change the sprites around to fit.

    Sorry, I know I am not answering your main question regarding the ball/gem/candy orientation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:2dkp5yjo]

    but doesn't the main candy area never move when flipping between landscape and portrait?

    The main candy area has to move because the north to south changes when the orientation changes and so the candies then must then drop in another direction.

    In Construct 2 itself, I think I can compare Window Height and Window Width and place the HUD elements accordingly. It's the balls/candies that is the problem.

  • [quote:3qd7cvzi]

    but doesn't the main candy area never move when flipping between landscape and portrait?

    The main candy area has to move because the north to south changes when the orientation changes and so the candies then must then drop in another direction.

    In Construct 2 itself, I think I can compare Window Height and Window Width and place the HUD elements accordingly. It's the balls/candies that is the problem.

    I don't have the code for you, but I suppose you would just save the current ball locations to an array, change the orientation, use the array to put the balls back in the correct spot, and then your game play would have to account for the new dropping direction.

  • Thanks for your suggestion. It does seem to be the easiest way to deal with the candies. Thanks again.

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