Extensions Random Object

object class.randomObject ( )

Returns the table of one of the class's object instances selected at random.

Parameters

There are no parameters.

Return Values

object Object instance table

Example

-- Assume we have "Goomba" objects on the frame
local GoombaClass = mmf.newObjectClass("Goomba")
 
-- Destroy a Goomba at random
if (GoombaClass.objectCount > 0) then
  GoombaClass.randomObject().destroy()
end

Copyright 2010 Justin Aquadro