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
defaultparameter(0,0)
defaultparameter(0,20,100,200,"Not Default")
End Method
End Class
' Like with variable declaration you can set a value to
' a variable in a function or method.
Function defaultparameter(x:Int,y:Int,a:Int=10,b:Int=20,c:String="default")
DrawText "a="+a+" b="+b+" c="+c,x,y
End Function
Function Main()
New MyGame()
End Function
Artificial intelligence/templates/examples/rts/rpg/strategy ect. in MonkeyX/CerberusX language. You can download the free version of MonkeyX from itch.io or Cerberus-x.com The Flash applets will stop working in around 2020.
Friday, February 3, 2017
Monkey-X - Getting Started - Default Parameters - code example
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.