public PlatformObject(World world, Vector2 position) { // because it's a TetrisObject we get the size and texture from the TetrisSet Vector2 size = TetrisSet.getSize(TetrisSet.Type.Tfloor); Texture2D texture = TetrisSet.getTexture(TetrisSet.Type.Tfloor); // create the real item platform = new DrawablePhysicsObject(world, texture, size, mass); platform.Position = position; platform.body.BodyType = bodyType; }
public TetrisObject(World world, TetrisSet.Type type, Vector2 position, float rotation) { // because it's a TetrisObject we get the size and texture from the TetrisSet Vector2 size = TetrisSet.getSize(type); Texture2D texture = TetrisSet.getTexture(type); // create the real block block = new DrawablePhysicsObject(world, texture, size, mass); block.Position = position; block.body.Rotation = rotation; block.body.Friction = friction; block.body.Restitution = restitution; block.body.BodyType = bodyType; }