GetNumCollisions

From MaratisWiki
(Difference between revisions)
Jump to: navigation, search
m
m
 
Line 2: Line 2:
  
 
Get the number of collisions for an object.
 
Get the number of collisions for an object.
 +
 +
{{lua-function-param|object|object to operate on}}
  
 
'''Example:''' Numbers of collisions for object will be displayed in maratis console window.
 
'''Example:''' Numbers of collisions for object will be displayed in maratis console window.

Latest revision as of 00:27, 9 February 2014

getNumCollisions(object)

Get the number of collisions for an object.

  • object : object to operate on

Example: Numbers of collisions for object will be displayed in maratis console window.

   object = getObject("object")
   function onSceneUpdate()
       Coll = getNumCollisions(object) -- you can rename Coll whatever you want
       print(Coll)
   end

Check YoFrankie demo for a perfect example, this is used on the FeetBox there. This is one thing you should use to make a character jumping.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox