Hello
I am working on a game app, and have come across a snag.
The platforms that i have spawning spawn “inside” one another.
This is not what i had intended.
I do not want to add all of my code unless i need too.
local pnorm = display.newImage("platform\_normal2.png"); pnorm.x = display.contentCenterX + math.random(-110, 110) pnorm.y = 615 pnorm.xScale = 1 pnorm.yScale = 1 physics.addBody( pnorm, "dynamic", { density=1, friction=0, bounce=0} ) pnorm.gravityScale = gravity pnorm:applyForce(0, -1, pnorm.x, pnorm.y) pnorm.isFixedRotation = true pnorm.myName = "Normal Platform"
there are multiple types of platforms, each of which have their own characteristics.
This code is from the Normal ones.
They spawn “off screen” in random packs of 1-3 with random characteristics.
I’m wanting to add something to auto adjust their spawning, so that they are directly left.right of one another.(if they spawn inside eachother)
At times they will spawn, fairly spread out.
Other times, they are severely clumped up.
I tried to use a filter, but that didn’t look to good.
best way i can think to show you what i am talking about is an image.
Thanks for any advice!
I’ve been working on this issue for quite awhile, and cannot come up with a solution.
Let me know if more info is needed!