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.
Here some code that shows you how to slice strings. Slicing in Monkey is what mid$ is in Basic.
Code Below : (Cope and Paste the code in a empty Monkey Project)
Import mojo Class MyGame Extends App Method OnCreate() SetUpdateRate(60) End Method Method OnUpdate() End Method Method OnRender() Local test:String="Part of a string." Cls(0,0,0) SetColor(255,255,255) DrawText "Complete string : ",10,10 DrawText "Sliced part of the String [0..4]: ",10,20 DrawText test,DeviceWidth*.5,10 DrawText test[0..4],DeviceWidth*.5,20 End End Function Main() New MyGame() End
Note: Only a member of this blog may post a comment.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.