Extensions Test Backdrop

boolean class.testBackdrop ( [number layer] )

Tests if any object that is a member of the object class is currently overlapping a backdrop obstacle.

If a layer is specified, the test is limited to that layer.  By default, layer is equal to mmf.ANY_LAYER.

Parameters

layer Optional.  1-based layer index, or constants mmf.ANY_LAYER, mmf.SAME_LAYER, or mmf.DIFF_LAYER 

Return Values

boolean true if an object is overlapping a backdrop obstacle, false otherwise

Example

-- Assume we have "Laser" objects on the frame
local laserClass = mmf.newObjectClass("Laser")
 
-- If a laser touches the backdrop, we're done for
if (laserClass.testBackdrop()) then
  print("Game Over!")
end


See also:
     Test Backdrop Get

Copyright 2010 Justin Aquadro