External Exam Download Resources Web Applications Games Recycle Bin

Collision Detection

1. Open movement_mc.fla

2. Add new movie clip (any name)

3. Drop clip onto stage but in new layer

4. Change Instance name in properties panel - myHitTestObject

5. Add onto previous action script -

 

if (this.hitTest(_root.myHitTestObject)) {
  _root.myHitTestObject._y -= 10;
}

 

6. Control --> Test Movie... use arrow keys to collide object into other object. What is reaction? Save as collision_mc.fla