Collision Detection

From ClayWiki

Jump to: navigation, search

Contents

Topic Summary: This topic will show you how to write code that detects when two Movie clip objects occupy the same space at the same time and create a collision. When a collision is detected, you can add a resulting action, such as your character scoring points or losing a life. Note: Collision Detection is also referred to as "Hit Test."


Prerequisites Needed

Topic Assignments

Read this tutorial on Hit Test (Collision Detection)

Adjust the hit area on the frog's tongue in the Fly Catcher Tutorial.


Update the Wiki

  • Upload the assets (.SWF and .FLA) you created to your Team page if you are working on a Team game, or to your "My Projects" page if you are working alone.


Update the Blog

  • Write a Blog post about this topic, share your learning experience!


Related Links and Tutorials


Search the Web for more information

Here are some search results on Flash ActionScript programming:


Image:Icons-mini-icon_user.gifImage:Icons-mini-icon_user.gifImage:Icons-mini-icon_user.gif Students Contributions

Here is an example of ball falling and landing on a platform:

Download the source code (FLA file) of this example to learn from it.


Here is an example of creating walls around the stage area so the character can't move off the stage:
Download the source code (FLA file) of this example to learn from it.

Here is an example of adding obstacles to the stage so that character can't move through them:
Download the source code (FLA file) of this example to learn from it.

Tiffany (tnt2010)



Austin (ArchlordoftheZ.S.)



Wolf The Lycan




bryan kycoo


Media:Collision_detedtion.fla

Anna (baby gurl)


Personal tools