Help with understanding "function scene:create( event )"

Really that easy huh.  So I understand that instead of destroying images you destroy the scene groups those images are in, cool.  Will do some testing and update although im pretty sure you solved it.  So in general I dont prefer any type over any other type, I prefer whichever is the most efficient.  If both are equal then I prefer not using create as create is pretty new to me :slight_smile: .  In all honesty, I took most of the way im doing this code from that folder of examples that you sent me around 3 weeks ago.  I am probably not following correct but im pretty sure your doing everything in create in those examples. 

I use these image sizes so that it can scale to any device.  I havent had problems with other devices so far.  If the best way is to use integer values then of course I switch all the code to this :slight_smile: .  In my eyes if I dont scale everything by device height and width then im relying on Corona to handle this which im sure is good but isnt what im doing make it exactly the definition of scalable to any device as im using actual height and width to decide the size of images?  Can I accomplish both the scalability that im saying and the problems you are saying by just making the number round to an integer or is my way of scaling just absolutely ridiculous and wrong haha?

In short, “No.”  Your scaling calculations are not the same as what Corona does.

However, both can result in unwanted artifacts and alignment issues.  So, if edge alignments are critical you have to account for that and:

  • Use a pixel-perfect config.lua solution
  • Use blending modes that don’t cause unwanted artifacts.
  • test, test … test 

You have to ask yourself,

  • What will this look like if my calculation produces a sub-pixel result?
  • Will the images all still line up?
  • Will there be gaps?
  • Will there be overlaps where I don’t want them?

How many devices have you tested on and what devices?  Once you test on a few devices with different resolution I suspect you’ll see what I’m getting at.

Note: At the end of the day none of this matters.  You should, at this point, simply be focused on learning. 

Hopefully you’re not intending to make a game for sale/money, but just to learn. 

In that case, even if the end result has imperfections it will have served the larger purpose.  A learning experience.

I defintely dont think I am doing what Corona does to scale images im sure Corona is much more complex.  I kinda thought what I was doing was making the size / placement universal on any device like this, I have a bit to learn. I have gone through every device in the corona simulator and physical devices, note 4, galaxy s6, galaxy s7, iphone x and iphone 6.  I have a pretty extensive config.lua file I found that I admit is making a lot of this work.  I mean really in the end I only faced problems with iOSx.  Edge alignments are critical in one place but I basically say line up image 2 right where image 1 ends and this way its always lined up.  I will do my rewrite using integers instead of these calculations and let Corona do its thing :slight_smile: .

I did release my app with no intentions and still no intentions of making money :slight_smile: .  I am an IT manager at a start up and want to transition to the programming side.  Programming alone was a little confusing at not knowing where to go and what to study.  I found with Corona I gained a much higher interest in programming as I could interact with apps and a community environment.  I put my app with ads and IAP really to just show I could do it.  The rewrite idea is to write one game somewhat efficiently then next games take concepts from there and try making a more complex situation (next game I want to use physics module extensively).  Putting the game out I have been told looks good on my cv that’s why I go for a whole build out with somewhat decent looking graphics.

In the end all the programmers I work with yell at me for studying LUA haha.  I have started to learn java, python and some mid level algorithims for interview questions through Udemy courses but am still addicted to programming using Corona as I feel I learn programming concepts better here.  I have a long way to go but the interest is there and ive been devoted for around 6-8 months to learn without going back to school, hopefully, one day developer can be my title :slight_smile: .  As always thanks for the help and time you put into your answers.

Note: I wasn’t saying make a change.  Just warning you it might not look right to do your calculations that way.
 
Don’t change it if it is working for you.   Finish instead, then work on a new project and consider changing your approach then.
 
This way you have more fun and get more things made.
 
Cheers,
Ed

Thanks.  I just wanted to add that I am no longer using create and tried the first example of the two examples and all is working and destroying correctly.