Import mojo Class player Field x:Int = 10 Field y:Int = 20 Field lives:Int = 3 End Global p:player = New player Class MyGame Extends App Method OnCreate() SetUpdateRate(60) End Method OnUpdate() End Method OnRender() Cls(0,0,0) SetColor(255,255,255) DrawText "Player x :" + p.x,10,10 DrawText "Player y :" + p.y,10,20 DrawText "Player Lives : " + p.lives,10,30 End End Function Main() New MyGame() End
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.
Wednesday, December 24, 2014
Monkey - Player Class and drawing player class variables to the screen code example.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.