A question about collision (probably very noobish)

Hey all :slight_smile:

I’m sure this is probably freakishly noobish, but I’m really struggling with the whole “collision” thing.

Basically, I just want to have an event that is triggered when an object touches the ground.

Being a GS convert there are plenty of things I find familiar to some extent with LUA (which surprised me) - however I can’t get my head around this.

Is there a simple way to do collision? Like “when object A touches object B _____”

Any help would be appreciated, particularly in the form of code, as I’m really, really confused. I’ve looked at the API page but it’s making it more confusing, lol XD

Thanks :slight_smile:
Peach. [import]uid: 10144 topic_id: 2977 reply_id: 302977[/import]

Have a look in the SampleCode folder of your installation, there is a sample there called CollisionDetection that is exactly what you are looking for ( plus a few more for more advanced collision detection) [import]uid: 9064 topic_id: 2977 reply_id: 8557[/import]

I’ve had a little look but I’m still a bit lost sadly; I’m currently looking at the pool table example which makes a little more sense to me.

Basically though, there’s no simpler way with LUA to say like “when A and B are touching”?

It’s OK if there’s not, I just thought there could be.

Then again, when I get this, I’m sure it will seem simple :slight_smile: [import]uid: 10144 topic_id: 2977 reply_id: 8558[/import]

Hi Peach,

give me 10 hours and I will create a new sample script. I am at work now.

Collision detection inside the game edition, right?

Cheers
Michael [import]uid: 5712 topic_id: 2977 reply_id: 8561[/import]

Hey Mike :slight_smile:

I’m in no hurry so that would be just great, thank you :slight_smile:

Yes, inside the Game Edition.

Cheers!
Peach.

PS - You mentioned a demo regarding an issue I was having with making the ball move away from touch in the other thread, did you have a link for that? [import]uid: 10144 topic_id: 2977 reply_id: 8564[/import]

I posted a note about here:

http://developer.anscamobile.com/forum/2010/10/19/corona-tutorial-script-jugglesoccerball [import]uid: 5712 topic_id: 2977 reply_id: 8568[/import]

Ah ha! I got it.

It took half an hour of fiddling with the pool table sample, but I worked out my “simple” way of getting it done :smiley:

Thanks very much again, but it seems, at least for now, I’ve got it working ^-^; [import]uid: 10144 topic_id: 2977 reply_id: 8569[/import]

I am glad you got it working. Maybe the script I posted is still helpfull. [import]uid: 5712 topic_id: 2977 reply_id: 8570[/import]

Ooh sorry I missed the previous post - that will DEFINITELY be helpful; thank you :smiley:

If this forum had rep I’d rep you, but for now you’ll have to settle for my gratitude ^-^; [import]uid: 10144 topic_id: 2977 reply_id: 8575[/import]