Search Tutorials
Advanced Example Here is a more advanced example of the Hit Test method create by Flashkit's Flashguru. However the code and the principles behind the movie are the same. Below the code is the movie in action. Adjust the bar to adjust the gravity then press the space bar to get the ball to jump. If it collides with the rectangles they will move up the screen. (The source code is available in the download.) if (this.hitTest( _root.ball)) {
setProperty (this, _y, this._y - 2);
_root.hits++;
gotoAndPlay (2);
}
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|