1

Currently I'm making a game in spritekit & swift but the problem is I've set the GameScene size with size:CGSize(width: 750, height: 1334) in GameViewController that extends the UIViewController.

The reason that I had set the size to 750 * 1334 is because I wanted to publish the game for iphone 6, but the problem is the will it be displayed wrongly in 6plus or iphone 5 ? Was it the right choice to set the size ?

Should I prepare the image for @2x and @3x ? Most of the ingame characters and images are set with 150 * 150 and it is well suited for the 750 * 1334 environment but should I set other resources? I fear if I submit my game it will be rejected . I would love to hear from the pros here !

Jennifer
  • 1,822
  • 2
  • 20
  • 45

1 Answers1

1

Setting the size to a particular value will definitely have implications on different devices. For example, if you test on an iPad, you'll likely find that some parts of the view visible that isn't visible on your iPhone 6 device. I know you didn't say you're supporting the iPad, but I just wanted to point out the fact that you'll get different gaming experiences for different screen sizes if you hard code the size.

That being said, depending on how the gameplay is, the extra space might not impact the gameplay at all. For instance, if the edge of your game screen consists of background imagery that doesn't contribute to overall gameplay, I think hard coding the size of the GameScene can be acceptable if all you cut off is the background imagery.

Anyhow, to avoid this inconsistency, I suggest you try setting the size as view.bounds.width and view.bounds.height respectively, which will guarantee your screen spans the full size of your device's screen. This isn't the solution for all games as it may cause scaling issues, but check it out and see how it looks on different devices.

Scaling the image for @2x and @3x is not hard, you should definitely put in time to do that.

Kelvin Lau
  • 6,373
  • 6
  • 34
  • 57
  • Thank you! But the problem is how will I be able to position my ingame characters and other nodes to a specific positions if I dont set the size and use view.bounds ? And is it possible to publish for only iphones ? – Jennifer Sep 20 '15 at 09:06
  • 1
    When you're building for multiple sized devices, you should avoid using exact points and use some ratio of the screen's dimensions. For instance, one of your sprites can start at `CGPointMake(view.bounds.width / 2, view.bounds.height / 2)`, while another might be at `CGPointMake(view.bounds.width / 2.25, view.bounds.height / 3.34)`. You'll need to play around to figure it out, but the result is you'll have a nicely proportioned game screen for all screen sizes. – Kelvin Lau Sep 20 '15 at 09:10
  • Thanks! I'm not sure how things will turn out but I'll try! – Jennifer Sep 20 '15 at 09:11