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 shows you how to draw a rectangle to the screen. The rectangle moves up and down.
Code below : (paste it into the monkey editor and run it)
Import mojo Global x:Int = 320 Global y:Int = 100 Global inc:Int = 1 Class MyGame Extends App Method OnCreate() SetUpdateRate(60) End Method OnUpdate() y+=inc If y>200 Then inc=-1 If y<100 Then inc=1 End Method OnRender() Cls(0,0,0) SetColor(255,0,0) DrawRect(x,y,16,16) 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.