Skip to content

touching

stevepaget edited this page Feb 16, 2016 · 1 revision

Detects collision between two sprites


Syntax:

touching(sprite1, sprite2)

Where:

sprite1 and sprite2 are existing sprites.

Returns True if the two sprites are touching (pixel perfect), and False if they are not.

eg:

 if touching(batSprite, ballSprite):
       #do something that means the ball hit the bat!
Clone this wiki locally