yeh so I wanted to make an object that your character couldnt touch and I asked the forum for an easier way in a thread "Moving Question, Stop ME". Well I got a reply that was good but unfourtunatly the script had many errors that I created from his answer. It was easier just to make this scrip (check downloads at bottom). Well, its pretty simple but it's a real pain to make so I thought that someone might enjoy using it in rpgs as like a rock or something.
Well you have to look at what you've done and see if you can pass the variables to it. Other wise you have to enter all that code again for each object you want to check.
Simplified Example:
//Get a couple of elements to work with
box=element("box1");
rectangle=element("box2");
Dude=element("dude")
function checkcollide(el,el2){//When you call the funtion you pass 2 elements
if el.element.collide(el2){
return true;
}else{
return false'
}
}//end funtion
then you can call it like
test=checkcollide(dude,rectangle)
test||checkcollide(dude,box)
then if dude is colliding with either one test will equal true
by the way another way to go is to put this code in the object box itself and replace all references to box to "this" and then clone the box and they all will inherite the code for themselves.