Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

How do you avoid hard coding coordinates of display elements in a game with multiple levels?
Started by danpreneur Jun 14 2016 07:12 PM

1 reply to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Enthusiast

  • 40 posts
  • Corona SDK

I'm designing a game with multiple levels with a variety of obstacle elements displayed across the screen from level to level. How do I avoid hard coding the coordinates of the obstacle elements such that the game looks consistent across an array of device resolutions?

[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 727 posts
  • Corona SDK

Well your designing your app in corona so Auto Sizing of an app and images are taken care of for you. You just need to include the proper Images and sizes and naming conventions @2.png @4.png etc...


But if i were trying to do what your talking about you could use a json or lua table to store the image name /size / screen size / and positions based on screen size in a file. Read the file and process it based on Screen size.


Some things may need to be calculated but what I have laid out here is your best bet.


Good Luck Larry