Monday, December 19, 2016

Monkey-X - Beginners - DebugLog and DebugStop - code example

Import mojo

Class MyGame Extends App
    Field cnt:Int=0
    Method OnCreate()
        SetUpdateRate(2)
    End Method
    Method OnUpdate()
        cnt+=1
        DebugLog "Contents of variable cnt :"+cnt
        If cnt>10 Then DebugStop
    End Method
    Method OnRender()
        Cls 0,0,0 
        SetColor 255,255,255
        
    End Method
End Class

Function Main()
    New MyGame()
End Function

No comments:

Post a Comment