<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://oxeyegames.com/wiki/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://oxeyegames.com/wiki/index.php?action=history&amp;feed=atom&amp;title=CreateEntity</id>
		<title>CreateEntity - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://oxeyegames.com/wiki/index.php?action=history&amp;feed=atom&amp;title=CreateEntity"/>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=CreateEntity&amp;action=history"/>
		<updated>2026-04-07T02:18:49Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://oxeyegames.com/wiki/index.php?title=CreateEntity&amp;diff=405&amp;oldid=prev</id>
		<title>Jeb: Created page with '{{PhysicsMethod| physics:createEntity(bodyDefinition, x, y) | Creates and adds a new physics body to the physics object. | {{MethodParam|bodyDefinition|A table|The body definitio...'</title>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=CreateEntity&amp;diff=405&amp;oldid=prev"/>
				<updated>2010-02-07T12:05:59Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#39;{{PhysicsMethod| physics:createEntity(bodyDefinition, x, y) | Creates and adds a new physics body to the physics object. | {{MethodParam|bodyDefinition|A table|The body definitio...&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PhysicsMethod|&lt;br /&gt;
physics:createEntity(bodyDefinition, x, y)&lt;br /&gt;
|&lt;br /&gt;
Creates and adds a new physics body to the physics object.&lt;br /&gt;
|&lt;br /&gt;
{{MethodParam|bodyDefinition|A table|The body definition table, see below.}}&lt;br /&gt;
{{MethodParam|x|A number|The entity's center X coordinate in world space, counted in meters.}}&lt;br /&gt;
{{MethodParam|y|A number|The entity's center Y coordinate in world space, counted in meters.}}&lt;br /&gt;
|&lt;br /&gt;
Returns the body identifier number (an integer). If something went horribly wrong (like, incorrect number of parameters), this method returns -1.&lt;br /&gt;
}}&lt;br /&gt;
=== Body Definition Table ===&lt;br /&gt;
&lt;br /&gt;
The body definition table holds entity settings.&lt;br /&gt;
&lt;br /&gt;
{| border=2 cellpadding=3 cellspacing=0 style=&amp;quot;margin: 0 0 1em 1em; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#c797d7&amp;quot;| '''Parameter'''&lt;br /&gt;
|style=&amp;quot;background:#c797d7&amp;quot;| '''Expected Type'''&lt;br /&gt;
|style=&amp;quot;background:#c797d7&amp;quot;| '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
{{MethodParam|linearDamping|A number|How much the entity's linear velocity should be dampened. You can use this to simulate air friction. Defaults to 0.}}&lt;br /&gt;
{{MethodParam|angularDamping|A number|How much the entity's angular speed should be dampened. You can use this to simulate friction. Defaults to 0.}}&lt;br /&gt;
{{MethodParam|fixedRotation|A boolean|Set this to true if the entity isn't allowed to rotate at all. Defaults to false.}}&lt;br /&gt;
{{MethodParam|isBullet|A boolean|Enables Box2D's special &amp;quot;bullet&amp;quot; physics. Defaults to false.}}&lt;br /&gt;
{{MethodParam|allowSleep|A boolean|Set this to false if the entity is never allowed to enter sleeping state. This occurs if the entity is non-moving for a certain amount of time. Defaults to true.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   local playerBodyDef = {&lt;br /&gt;
      linearDamping = 10,&lt;br /&gt;
      angularDamping = 1.5,&lt;br /&gt;
      fixedRotation = false,&lt;br /&gt;
      isBullet = false,&lt;br /&gt;
      allowSleep = false,&lt;br /&gt;
   }&lt;br /&gt;
   player.body = physics:createEntity(playerBodyDef, player.x * physResolution, player.y * physResolution)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jeb</name></author>	</entry>

	</feed>