Know the name of the object below

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Know the name of the object below

Post by JosepM » Mon Dec 20, 2010 1:08 am

Hi,


I have several graphics/images that I move over other graphics/images.
1) I want to know which zone they are

2) and How these areas would be activated when detect a graph over.

How can I know the name of the object below?

How to approach to with AnimationEngine?

Thanks in advance.

Salut,
Josep

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Know the name of the object below

Post by bn » Mon Dec 20, 2010 11:45 am

Hi Josep,

have a look at

http://forums.runrev.com/phpBB2/viewtop ... ect#p27200

there is a little stack that shows one way how to detect intersects. It uses the control IDs. You could derive a name from that easily.

See if that applies to your problem.

This is not animation engine specific. It is plain Livecode. I think AE also has some intersect detection, and advanced ones too for irregularily shaped polygons. But I don't know for shure.

regards

Bernd

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: Know the name of the object below

Post by JosepM » Mon Dec 20, 2010 11:58 am

Hi bn,

Thanks, it's a posible solution but I need always check all the posibilities, imagine a chess board and you find where is the Queen, I need to check each time all the board positions. I don't know if is the best way :(

I thinking about two alternatives to check the move:

1) check the tokens after the user move it, looking for the intersects.

2) select the token and show to the user the posibles zones of movement.

Option 1 have the problem of non permited movements, so after check where is the token maybe the user was performed a prohibited movement. It's better for the user move freely.

Option 2 have more control from me, and I think more easy to check so I translate the board to a array.

Thoughts?

Salut,
Josep

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Know the name of the object below

Post by bn » Mon Dec 20, 2010 12:27 pm

Hi Josep,

I am afraid you have to somehow know where your objects of interest are to determine if a moving object intersects.

One way to do that is build an array and test that. It is actually quite fast and works pretty well.

Have a look at

http://revonline2.runrev.com/stack/445/Colorpuzzle

This is one way to know where a puzzle piece is dropped which uses an array. This might apply to your problem.

Kind regards

Bernd

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: Know the name of the object below

Post by JosepM » Fri Dec 24, 2010 1:54 pm

Thanks :)

Post Reply

Return to “Animation Engine”