Forum Replies Created
-
AuthorPosts
-
Did you rebuild mojo after your change? When you modify a module you have to rebuild it or the change won’t be taken into account. Maybe you’ve messed up your monkey2 sources and should startup with a fresh install?
One antother important thing to know is that private behaves a bit different than in C++/java more like in D. i.e. things within the same .monkey2 file are allowed to share private things anywhere across the file. So there’s not only private things within classes/structs but you can have a private function to the file (function that is not the member of any class so it looks global but technicaly it’s not. Or you can have a class that is private to the file!).
About the error message, it looks like it’s a crash of mx2cc, the monkey2 compiler itself (not your executable)! Of course a compiler should not crash but return an error with the code line. You really don’t see that often so it is very interresting developpement wise. Very hard to debug if you are not writter of the compiler though. It be nice if you could post a little example code that generates it, ideally on github issues.
“Memory acces violation” is not a compile error but a runtime error. Here it happens during the semanting part of the build process while mx2cc is running.A normal build process will:
Parsing… (monkey2 job)
Semanting… (monkey2 job)
Translating… (monkey2 job)
Compiling… (C++ compiler job) Here you can have c++ error that looks more verbose than mx2 errors. But it should not happen ideally. It usually happesn when you play around with extenal stuffs.
Linking ~your_executable path~ (Linker job) I wish you to never have an error here while playing with externals because linking is a real PITA. One of the super strong sides of MX2 is it’s doing it for you.
Application built:~your_executable path~ everything worked ok, so now if there’s a runtime error you probably messed up somewhere but the different build stages could not help you detecting it. You have to build in debug mode if you want to be able to track the problem.About the license, you’re free to modify stuffs, you may make a fork of the original code via github. If you like the language there is a patreon page or a donate link.
I would be OK with adding some sort of ‘global’ shader override to Canvas.
For me everything that allows us to play nicely with custom glsl shaders is good to take!
“..” and “And” and “Or” !?
All of them would be usefull..Fields can be public, protected or private.. Properties have the same encspsulation levels.
Fields are also faster than properties. So IMO properties should only be used when they trigger something, not as an equvalent to field.
October 16, 2017 at 10:47 am in reply to: Is Mark pulling the plug on Monkey2? Worrying comments on Twitter #11122How many people is really using Monkey2 as it is today, and how many people plans on using it on the near future?
I plan to start a new project (mobile game) on mid december using mx2. I think it’s already functionnal now but did not try IOS becase I have no device for now.
The MX2 situation makes me sad a lot… The software is so great. I can’t imagine working with something else for now. Wether it’s Haxe, MX1, AGK or anything. The MX2 way to do things just feels right to me. Though a bit more complex than some competitors, you have the control over nearly everything and it’s very well featured so it has the right easy/”low level” factor for me. It’s also really cross platform.
I’m sad the community has not helped writing docs,manuals, tutos, vids. There are some but trying to organize ourselves was not a real success though a lot of suggestions were there. When I tried to help making nice language reference, there was a lot of speech but nearly no actions.. For me this would make a huge difference, more than the considerations about the name and color of the site and other superficial stuff that actually irritates me a lot. We can work on MX2’s marketing too, when can even fork it and give it some fancy name if we want so there’s no problem there.
I love MX2 and as long as it’s usable I will use it, and as long as there’s a patreon I will patreon, even if Mark has only half a day per week/month to give to MX2.
And thanks to Mark Sibly for the great experiment it was for me to observe the creation of a new language. I learnt a lot this last year.
I shall use it when I’ll start creating my next game. (Mid December)
Too bad it’s not on Github though. I’m pretty sure I’ll want to fork it and customise some stuff.I’ve already posted an issue about this…
You can check if the file was loaded and send an error at runtime but I’d rather like it at compile time too.https://github.com/blitz-research/monkey2/issues/186
For games, on andrid there’s “google play games”, on ios it’s on the “game center” I think, but I only have an android for now..
(dunno for files cloud)I’d personally suggest an unused character like {} for example. It’s the chars used for defining sets in math notation so it’s kind of relevant to me.
you have the databuffer, wich you can find in some of the mx2 source.
Here’s some code I used in the past. It’s not fixed size but well you can just put a constant instead of ‘str.CStringLength’..
Now I learn that Strings can be implicitly converted to Cstrings so I won’t use it anymore but if you need fixed size It may be what you need.. If you method looks to not work so well finaly.Local mydata:=New DataBuffer( str.CStringLength ) ‘the length is in Bytes!
str.ToCString( mydata.Data,mydata.Length )Wow though I had to convert it myself!
Mx2 strings are not Cstrings. Checkout the toCString method.
Floats are not exact type. For example you can’t have a true 0.1 in float. When you assign the value to the float it will slightly change (if there’s something at the right of the dot).
You will have to round the number in some way if you want to print it with just 3 symbols at the right of the dot.
Don’t know if there is some build in rounder function. BUT you’ll never be shure you get the exact value back because the computer has not stored 3.141 but the nearest float.
For example floats are prohibited in banking applications.You have the Millisecs() function for that
Here’s a little example, don’t know if it’s accurate enough for you. I assume OnKeyEvent should be more accurate than OnUpdate (I suppose putting it in OnRender with “If Keyboard.KeyDown(Key.Space)” is a bad idea as it is called more or less at 60 fps)
[/crayon]Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647[crayon-5cbaa15fee889290732336 inline="true" ]Namespace myapp#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class MyWindow Extends WindowField spaceTime:=0Field backspaceTime:=0Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=Null )Super.New( title,width,height,flags )EndMethod OnKeyEvent( event:KeyEvent ) OverrideIf event.Type=EventType.KeyDownIf event.Key=Key.SpacespaceTime=Millisecs()Elseif event.Key=Key.BackspacebackspaceTime=Millisecs()EndifendifEndMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender()canvas.DrawText( "space time: "+spaceTime+" - backspace time: "+backspaceTime,100,Height/2 )EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()End -
AuthorPosts