Public Sub Tick (GS As X2GameStep)
updateCamera
TileMap.DrawScreen(Array("background", "foreground"), GS.DrawingTasks)
mKingHuman.Tick(GS)
HandleTouches
End Sub
Public Sub updateCamera
Dim fuerzaX As Float = 0.06
Dim fuerzaY As Float = 0.04
Dim posx As Float = X2.ScreenAABB.Center.X
Dim posy As Float = X2.ScreenAABB.Center.Y
Dim difX, difY As Float
difY = ((mKingHuman.bw.Body.Position.Y+0.6-posy)*fuerzaY)
If mKingHuman.FaceRight = False Then
difX = ((mKingHuman.bw.Body.Position.x+0.5-posx)*fuerzaX)
Else
difX =((mKingHuman.bw.Body.Position.x-0.5-posx)*fuerzaX)
End If
If difX > 0.2 Then difX = 0.2
If difX < -0.2 Then difX = -0.2
posx = posx + difX
posy = posy + difY
X2.UpdateWorldCenter(getVec(X2.ScreenAABB.Center.X,posy))
'SET LIMITS HERE
'...
End Sub