How do I support both Orientations?

Get help using Construct 2

Post » Sun Mar 30, 2014 9:37 am

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.
B
4
Posts: 28
Reputation: 280

Post » Sun Mar 30, 2014 1:34 pm

You shouldn't need to do anything at all. Just use letterbox scale mode and the game will automatically scale accordingly when changing orientation.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Sun Mar 30, 2014 3:54 pm

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?
B
4
Posts: 28
Reputation: 280

Post » Mon Mar 31, 2014 8:32 am

Bumping the thread in the hope that someone might have the answer I'm looking for.
B
4
Posts: 28
Reputation: 280

Post » Mon Mar 31, 2014 12:50 pm

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.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Mon Mar 31, 2014 4:15 pm

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?
B
4
Posts: 28
Reputation: 280

Post » Mon Mar 31, 2014 5:36 pm

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.
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Post » Mon Mar 31, 2014 7:02 pm

@Manley23 - "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.
B
4
Posts: 28
Reputation: 280

Post » Mon Mar 31, 2014 8:05 pm

@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.
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Post » Tue Apr 01, 2014 9:27 am

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.
B
4
Posts: 28
Reputation: 280

Next

Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, ketramtu18, OddConfection, XMatrix and 9 guests