Forum Replies Created
-
AuthorPosts
-
Ok, that makes sense I guess
Thanks for the quick help
I have the node class placed inside the unit class. The other node class is inside the pathfinder class. Should the node class be outside both in order to work?
Thanks!
Though I am getting an error trying to put it in my project.
Monkey123'Local lst:=mypath.getpath()i.path := mypath.getpath()When I Local the list then I get no error. But when I want to transfer the list into my unit class its path list (i) I get the error message.
Monkey1Error : Expecting end of lineI tried to remove the : character but then I get the message :
Monkey1Error : Unable to convert value from type 'std.collections.List<default.pathfinder.pathnode>' to type 'std.collections.List<default.unit.pathnode>Great!! I had not expected it was in already
I will be using that shortcut a lot from now on I think.
I am often lost in my code. Is there already, or can there be a keyboard shortcut (and buttons) to go forward and backwards to previous cursor positions? Say you modify one area in the code and need to lookup or change something elsewhere and you are there with the cursor(lost!) and .. then with a feature you can skip back to a previous part in the code where you where. (cursor history)
Kind of like the undo but without modifying anything.
That look as how I usually use classes. Only what is the Unitcollection for?
btw – I just discovered a thing with functions and methods that took me a while to fix. I got a error when I had a function inside a class trying to use a list inside the same class. This is not possible. You need to make it a method. Methods have access to the data fields in the class it appears.
I added several new things. One is a interface with which you can move units and give them commands. Works with the left mouse button. I could not get the touch controls working yet. Still some difficulties there.
The interface can be docked. Also I added fog of war.
Here the new web version (v0.2)
https://cromdesi.home.xs4all.nl/emscripten/civclone02/Main.html
Attachments:
I had not thought of the controls yet. I think I will need to add some sort of gui.
It is only tested on windows at the moment.
I am still a little bit confused on functions and methods. The difference between them.
Ohh, I did not notice that
Seems to work now.
Here is a example. I want to have methods in the class that update everything. Here below it does not seem to work. I can call the method that should update all the things in the list but it only updates 1.
Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class unitField x:Int,y:Intmethod New(mx:Int,my:Int)Self.x = mxSelf.y = myEnd MethodMethod moveallright()For Local i:=Eachin myuniti.x+=Rnd(2)NextEnd MethodMethod drawall(canvas:Canvas)canvas.Color = Color.WhiteFor Local i:=Eachin myunitcanvas.DrawCircle(x,y,50)NextEnd MethodEnd ClassGlobal myunit:List<unit> = New List<unit>Class MyWindow Extends WindowMethod New()myunit.AddFirst(New unit(10,10))myunit.AddFirst(New unit(110,110))End MethodMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender() ' Activate this methodmyunit.First.moveallright()myunit.First.drawall(canvas)' if key escape then quitIf Keyboard.KeyReleased(Key.Escape) Then App.Terminate()End MethodEnd ClassFunction Main()New AppInstanceNew MyWindowApp.Run()End Function@difference – Thanks, I did not know this yet.
Where can I find the monkey2 manual? I only see docs on the top of this site.
I have no controls for the website. It is free space from my internet provider. I can only use a ftp to upload. They call it cloud space also.
I will send a message to their twitter to check if they can do something.
I noticed I kept the old link to Monkey in my start menu. I have been using the previous version of monkey. I replaced it with a link to the new monkey version. I have also reinstalled the emscripten by following the guide in the monkey about window. I also unzipped that emscripten folder as was shown in the env_windows file.
I am not sure if things will change but I hope it does.
Edit: Broken – I renamed the devtools/emscripten folder and it looks like it is rebuilding now.
Edit:I can compile wasm again but when I upload to the website the old cashed version loads and not the new. I will just rename the folders from now on until new versions come along.
-
AuthorPosts
