Public Sub Start
X2.Reset
TileMap.Initialize(X2, File.DirAssets, "hello world with background.json", Null)
TileMap.SetSingleTileDimensionsInMeters(X2.ScreenAABB.Width / TileMap.TilesPerRow, X2.ScreenAABB.Height / TileMap.TilesPerColumn)
TileMap.PrepareObjectsDef(ObjectLayer)
Earth = TileMap.CreateObject2ByName(ObjectLayer, "earth")
Sun = TileMap.CreateObject2ByName(ObjectLayer, "sun")
Earth.Body.ApplyForceToCenter(X2.CreateVec2(0, 30))
Earth.Body.AngularVelocity = 3
Dim v As B2Vec2 = Earth.Body.Position.CreateCopy
v.SubtractFromThis(Sun.Body.Position)
Dim rope As B2RopeJointDef
rope.Initialize(Sun.Body, Earth.Body, X2.CreateVec2(0, 0), X2.CreateVec2(0, 0), v.Length)
world.CreateJoint(rope)
X2.Start
End Sub