Collision Detection - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Collision Detection

Description:

State of the art 3-d games use hitboxes. Square characters are boring _root.guy _root.guy.head ... (guy.leftFoot.hitTest(enemy )) || (guy.rightFoot.hitTest(enemy) ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 9
Provided by: Jef5253
Category:
Tags: collision | detection | game | guy | the

less

Transcript and Presenter's Notes

Title: Collision Detection


1
Collision Detection
2
hitTest()
  • Gets sent a movie clip
  • Checks the movie clip it was called from and the
    movie clip it was sent for collisions
  • Returns a true or a false

3
if (square.hitTest(circle)) // something
important happens here
Returns true Something important happens
Returns false Nothing happens
4
Nothings Easy
  • Computers are not fast enough to calculate
    collisions between complex shapes
  • State of the art 3-d games use hitboxes
  • Square characters are boring

5
(No Transcript)
6
_root.guy.head_root.guy.leftHand_root.guy.rightH
and_root.guy.body_root.guy.leftFoot_root.guy.ri
ghtFoot
_root.guy
7
  • hitTest would be written in onClipEvent(enter)Fram
    e
  • 6 6 36
  • 6 6 46656

8
if (guy.hitTest(enemy)) if ((guy.head.hitTest(en
emy)) (guy.leftHand.hitTest(enemy))
(guy.rightHand.hitTest(enemy))
(guy.body.hitTest(enemy)) (guy.leftFoot.hi
tTest(enemy )) (guy.rightFoot.hitTest(enemy))
) // something important
Write a Comment
User Comments (0)
About PowerShow.com