Ground not keeping consistent size for different simulators

When I replace display.newImage() with display.newImageRect I get the error"Attempt to index local ‘ground2’ (a nil value)", which is the first time ground2 is called after display.newImageRect(), with makes me think display.newImageRect() didn’t load the image.

Thank you for helping me this far

Are there any other messages in your terminal window?  Is there more to the backtrace?

Can you post your new code?  You need to make sure you’re passing the right parameters in.  display.newImageRect() requires a width and height of the image to be specified.  If you leave those out you might get a similar error.

Rob

Thank you, this worked.