Private Sub Fire
Dim template As X2TileObjectTemplate = TileMap.GetObjectTemplateByName(ObjectLayer, "bullet")
template.BodyDef.Position = Kane.Body.Position
'set the velocity direction based on the cannon direction.
template.BodyDef.LinearVelocity = Kane.Body.Transform.MultiplyRot(X2.CreateVec2(30, 0))
'better simulation of fast moving objects
template.BodyDef.Bullet = True
TileMap.CreateObject(template)
End Sub