I´ve modified this example from balls to boxes and some other things. I hope it
solves your problem.

Behavior attached to some sprite:

on mouseUp me
  w=sprite(me.spriteNum).member
  w.resetWorld()
  box=w.newModelResource("box", #box)
  box.radius=1
  box1=w.newModel("box1", box)
  box2=w.newModel("box2", box)

  box1.addModifier(#collision)
  box1.collision.enabled=true

  box2.addModifier(#collision)
  box2.collision.enabled=true

  box1.collision.resolve=true
  box2.collision.resolve=true

  box1.collision.setCollisionCallBack(#col, ("callscript"))
  box2.collision.setCollisionCallBack(#col, ("callscript"))
end

Movie script:

on CallSpcript me
  on col me, colData
  beep
  datlist=[coldata.modela, coldata.modelb, coldata.pointOfContact,
coldata.collisionNormal]
  sendAllSprites (#collisionNotification, datlist)
end

Another movie script puts the info into the stage:

on collisionNotification me, collisionData
  sprite(me.spritenum).member.text = string(collisionData)
end

on beginsprite me
  sprite(me.spritenum).member.text = ""
end


Agustín



Magnus Ewald wrote:

> Hi List
>
> Im a 8.5 newbie and i am trying to get the collision detection working with
> a "setCollisionCallback()", but i cant get it to work. I have 2 models,
> "box" and "box2", how do I easyest ,to say, show an alert message when these
> collide ?
>
> thanx /magnus
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
> email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo.  Thanks!]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to