{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSCI 1106 Movement and Collision Detection

Two scenarios 0 vercal wall horizontal

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dea: Once sprite is no longer on stage, hide it •  How do we know when a sprite is no longer on stage? –  Sprite is at the top wall: y position > 180! –  Sprite is at the bodom wall: y position < -180 ! –  Sprite is at the lee wall: x position < -240 ! –  Sprite is at the right wall: x position > 240 ! •  Where do we perform the test? •  If the test is posi:ve: remove or hide the sprite •  Is there an easier way? Falling Off when Touching the Edge •  Idea: If the sprite is touching an edge, hide it Bouncing of the Wall 0° •  Idea: Once a sprite touches a wall, reverse velocity •  How do we know the new direc:on? •  Two scenarios θ - θ 0° –  Ver:cal wall θ - θ –  Horizontal...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online