I know you can add gravity to the entire scene but can you also add gravity to individual objects within the scene?
[import]uid: 34126 topic_id: 6508 reply_id: 306508[/import]
I know you can add gravity to the entire scene but can you also add gravity to individual objects within the scene?
[import]uid: 34126 topic_id: 6508 reply_id: 306508[/import]
There’s a way to do that in box2d, there it’s called radial gravity. Maybe the more experienced Corona programmers can put something together to illustrate that. I can’t help you more than that cuz I’m just getting started with Corona, google it and you might find the example by Nick Vellios. (think that was his name) [import]uid: 13560 topic_id: 6508 reply_id: 22588[/import]
Gravity is essentially an automatic use of applyForce() so you can probably achieve the effect you want using that command. [import]uid: 12108 topic_id: 6508 reply_id: 22593[/import]
So I guess if I use applyForce() and set the x = 0, and the y = what ever value works best and then just define the character as a physics object?
How would the physics engine or objects react to each other when they are close to one and the other?
If I have a character running around and jumping between objects like in a platformer game, how would he then know what objects gravity to attract himself to?
There’s a game called Soozies that does this where the character can run around the objects that are mostly circles or rounded shapes, then when the character jumps near another object that is above the he then rotates 180 degrees and attracts to the gravity of that object.
Theres a free version of the game too, check it out if my description was unclear. [import]uid: 34126 topic_id: 6508 reply_id: 22600[/import]
You would check the character’s proximity to objects and apply forces in different directions based on that. [import]uid: 12108 topic_id: 6508 reply_id: 22601[/import]