In my app i want to use balls .

As you can tell by the title I want to use balls in my app . I checked out a tutorial on radius : https://docs.coronalabs.com/api/type/Number.html

I have numerous questions .

  1. When I have balls they have transparent sides which makes it look like the ball is bouncing on air will this fix that ?
  2. in this tutorial it does not tell you how to calculate the radius of the circle how do I do this ?
  3. what is local n1 and local n2 ect. in this tutorial?

                                      Thank you for your help!

I see nothing in that link about balls or radius and I’m not sure what you mean by your first two questions. Nonetheless, you might find the following helpful:

local physics = require "physics" physics.start() local myCircle = display.newCircle(0, 0, 10) physics.addBody(myCircle, "dynamic", {radius = myCircle.width/2}) physics.setGravity(1,1)

The display.newCircle() function takes three arguments ( I used 0, 0 and 10). The first is the x-coordinate for the circle you are creating, the second is the y-coordinate, and the third is its radius.

The physics.addBody() function takes three arguments. First is the object you want to add to the physics simulation, second is the body type and the third is a table of properties. This table is where you can specify, among other things, the physics radius of object.

The radius I have specified above is half the width of myCircle, which should make sense.

As for question 3, n1 and n2 are arbitrary variable names. Just as I used myCircle above to name my circle object, I could have used bigCircle, or whiteCircle, or anything else really, even just c. These names have no special meaning to either corona or lua. In the link you gave, these are just being used to demonstrate the kinds of numbers you can use. They could have called them number1, number2, etc and it would have made no difference.

I see nothing in that link about balls or radius and I’m not sure what you mean by your first two questions. Nonetheless, you might find the following helpful:

local physics = require "physics" physics.start() local myCircle = display.newCircle(0, 0, 10) physics.addBody(myCircle, "dynamic", {radius = myCircle.width/2}) physics.setGravity(1,1)

The display.newCircle() function takes three arguments ( I used 0, 0 and 10). The first is the x-coordinate for the circle you are creating, the second is the y-coordinate, and the third is its radius.

The physics.addBody() function takes three arguments. First is the object you want to add to the physics simulation, second is the body type and the third is a table of properties. This table is where you can specify, among other things, the physics radius of object.

The radius I have specified above is half the width of myCircle, which should make sense.

As for question 3, n1 and n2 are arbitrary variable names. Just as I used myCircle above to name my circle object, I could have used bigCircle, or whiteCircle, or anything else really, even just c. These names have no special meaning to either corona or lua. In the link you gave, these are just being used to demonstrate the kinds of numbers you can use. They could have called them number1, number2, etc and it would have made no difference.