Hello All,
I am starting with the Rev and would like to know how to pick up if an object (e.g. graphic) is moving over another say, graphic object. Typical example would a toxic cloud moving over the houses! By the way, I am new to object oriented programming so any explanation provided should be explained in a simple manner.
Thanks!
Regards,
Vladimir
Object interaction
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Object interaction
Hi Vladimir,
I assume you want to check if 2 objects collide. If so, you will want to check the dictionary for "intersect" and "is in".
eg:
if intersect(graphic "cloud",graphic "house") then
-- they collided
end if
The build in handlers are not very acurate though. intersect will only check for the bounding rectangles of objects. If you need to get more fancy with the tests and are more compfortable with the rev language, you might want to take a look at animationEngine. It comes with a lot of methods to check for collisions.
All the best,
Malte
I assume you want to check if 2 objects collide. If so, you will want to check the dictionary for "intersect" and "is in".
eg:
if intersect(graphic "cloud",graphic "house") then
-- they collided
end if
The build in handlers are not very acurate though. intersect will only check for the bounding rectangles of objects. If you need to get more fancy with the tests and are more compfortable with the rev language, you might want to take a look at animationEngine. It comes with a lot of methods to check for collisions.
All the best,
Malte
-
- Posts: 14
- Joined: Mon Dec 21, 2009 10:37 pm
Re: Object interaction
Hi Malte,
Very many thanks! That is exactly what I wanted and at this stage (prototyping) it is more than sufficient.
Best regards,
Vladimir
Very many thanks! That is exactly what I wanted and at this stage (prototyping) it is more than sufficient.
Best regards,
Vladimir