body : getAngle ())) end ) Methodsī2.Body:applyAngularImpulse applies an angular impulseī2.Body:applyForce applies a force at a world pointī2.Body:applyLinearImpulse applies an impulse at a pointī2.Body:createFixture creates a fixture and attach it to this bodyī2.Body:destroyFixture destroys a fixtureī2.Body:getAngle returns the current world rotation angle in radiansī2.Body:getAngularDamping returns the angular damping of the bodyī2.Body:getAngularVelocity returns the angular velocityī2.Body:getGravityScale returns the gravity scale of the bodyī2.Body:getInertia returns the rotational inertia of the body about the local origin in kg-m^2ī2.Body:getLinearDamping returns the linear damping of the bodyī2.Body:getLinearVelocity returns the linear velocity of the center of massī2.Body:getLocalCenter returns the local position of the center of massī2.Body:getLocalVector returns the world coordinates of a vector given the local coordinatesī2.Body:getMass returns the total mass of the body in kilograms (kg)ī2.Body:getPosition returns the world body origin positionī2.Body:getWorldCenter returns the world position of the center of massī2.Body:isActive returns the active state of the bodyī2.Body:isAwake returns the sleeping state of the bodyī2.Body:setActive sets the active state of the bodyī2.Body:setAngularDamping sets the angular damping of the bodyī2.Body:setAngularVelocity sets the angular velocityī2.Body:setAwake sets the sleep state of the bodyī2.Body:setGravityScale strengthens or weakens the effect of the world gravity on a bodyī2.Body:setLinearDamping sets the linear damping of the bodyī2.Body:setLinearVelocity sets the linear velocity of the center of massī2. TNT Particle Engine: Great particles library for Gideros Studio to use with your game. There are nice videos and usage examples in their web page (make sure you also check the free version, see link below) Free tools. Output can directly be used in Gideros Studio. Joints Demo that shows how to use a variety of different Box2D joints to. body : getPosition ()) ball : setRotation ( math.rad ( ball. R.U.B.E is a Box2D editor which can edit a Box2D world. Over time all Marmalade types, classes, functions and constants will be moved. These are good defaults! world : step ( 1 / 60, 8, 3 ) ball : setPosition ( ball. After Gideros Player opens, the start and stop icons become enabled. Now select PlayerStart Local Player to start Gideros Player. ENTER_FRAME, function () - edit the step values if required. At the first part of this tutorial, we just want to run our code in Gideos Player and print Hello Ball to the console. body = body -add to scene stage : addChild ( ball ) stage : addEventListener ( Event. new ( "ball.png" )) -reference center of the ball for positioning ball : setAnchorPoint ( 0.5, 0.5 ) ball : setPosition ( 100, 100 ) -get radius local radius = ball : getWidth () / 2 -create box2d physical object local body = world : createBody ball. new ( 0, 10, true ) -create ball bitmap object from ball graphic local ball = Bitmap.
0 Comments
Leave a Reply. |