Ball inside a Bubble

Hi everyone
I am trying to create a simple example that will be, a ball will enter on a bubble and then it will go up, i am making using physics and collisions and is some like that:

when my ball touch on the bubble, both should have the same X and Y values and the physics gravity values will change, and the physics gravity is working, but i dont know the best way to do the other part, that is the bubble will have the same X and Y values that the ball have, it is used on blast monkeys and a lot of other games, if anyone have some ideia how i can do it will be great.
Thanks [import]uid: 26056 topic_id: 22709 reply_id: 322709[/import]

The simplest way would be :

  1. Ball and bubble touch.
  2. Remove Ball image.
  3. Change bubble image to new “Ball in bubble” image.

That way you only have to worry about one.
Otherwise you could turn off physics for the ball and just set
ball.x,ball.y = bubble.x,bubble.y I suppose. [import]uid: 10389 topic_id: 22709 reply_id: 90619[/import]

There is some 3rd party software that utilizes Corona called Physics Editor.

http://www.physicseditor.de/features/

What nice about it, is that you can drag different points in order to make a custom physics body. For example you could make it so that a circle line is around the big ball, and the smaller ball with physics inside it is inside that ball. Cheetomoskeeto has a great tutorial on the Physics Editor that you should check out:

http://www.youtube.com/watch?v=DL_or4XKTfU

Basically then, both of your balls would have physics, and the physics body of the larger one wouldn’t allow the smaller one to escape.

Hope this helps :slight_smile:

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 22709 reply_id: 90670[/import]

@Blickon, dunno if after the advice of two corona Ambassadors, you would want any other links, however, is this what you are trying to achieve? It is a quick and dirty way.

http://youtu.be/hRNZx_qO5uM

Jayant

@ozapps | http://howto.oz-apps.com | http://reviewme.oz-apps.com [import]uid: 3826 topic_id: 22709 reply_id: 90707[/import]

Hi everyone
Thanks for all the answers, the first answers: i tried some like it, but with some differences i will try it again

answer two: i saw the link and the information, thanks :slight_smile:

OzApps: It is really what i need, how can i have some more help about it?

Thanks [import]uid: 26056 topic_id: 22709 reply_id: 90760[/import]

Oz Apps, can i have some help to create a example similar on this video?
Thanks [import]uid: 26056 topic_id: 22709 reply_id: 91532[/import]

Hi Blickon,
sorry I got side tracked as my site was hacked or infected, so my resources are at the moment diverted to get that back up and running. I will post an article on how to do that soon on my howto.oz-apps.com site


twitter:@ozapps | http://howto.oz-apps.com | http://reviewme.oz-apps.com [import]uid: 3826 topic_id: 22709 reply_id: 91533[/import]

Ok Oz Apps, i will following your website :slight_smile: Thanks [import]uid: 26056 topic_id: 22709 reply_id: 91695[/import]

Hi Oz apps, i am following your http://howto.oz-apps.com , but it dont have nothing about the video on the youtube that you show me, i done a code similar, but on the video it seems better than my original demo, because of the ball physics, when the ball will enter on the bubble, it is better than my demo, can you post it http://howto.oz-apps.com ? [import]uid: 26056 topic_id: 22709 reply_id: 93315[/import]