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.
The code below fills a section of the screen with red rectangles. The rectangles only get drawn when the random value is 1. Two for loops are used.
Import mojo Class MyGame Extends App Method OnCreate() SetUpdateRate(60) End Method OnUpdate() End Method OnRender() Cls(0,0,0) SetColor(255,0,0) For Local y:Int = 3 To 10 For Local x:Int = 3 To 10 If Int(Rnd(2)) = 1 Then DrawRect(x*16,y*16,16,16) End End 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.