Hello there.
I am currently learning Monkey and am following a tutorial I found. I am putting an image inside the `MyProject.build > html5 > data` folder but when I run my code it deletes the image but I don't know why or how to prevent this from happening.
The code I am using now follows;
Import mojo
' Required my Monkey
Function Main()
New Game
End
Class Game Extends App
Field player:Image
Field x:Float
Field y:Float
Method OnCreate()
player = LoadImage("boing.png")
End
Method OnUpdate()
If KeyDown(KEY_LEFT) Then x=x-4
If KeyDown(KEY_RIGHT) Then x=x+4
If KeyDown(KEY_UP) Then y=y-4
If KeyDown(KEY_DOWN) Then y=y+4
End
Method OnRender()
Cls 64,96,128
DrawImage player,x,y
End
End
|