Friday, February 3, 2017

Monkey-X - Getting Started - Exit - code example


Import mojo

Class MyGame Extends App
    Method OnCreate()
        SetUpdateRate(60)
    End Method
    Method OnUpdate()   
    End Method
    Method OnRender()
        Cls 0,0,0 
        SetColor 255,255,255
        Scale 2,2
        For Local i=0 To 10
            DrawText "value i = "+i,0,i*10
            If i>=5 Then Exit ' <<<<<<<<<< Exit here on condition
        Next
    End Method
End Class

Function Main()
    New MyGame()
End Function

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.