Forum Replies Created
-
AuthorPosts
-
Interesting. It would be really nice if we can compile some guidelines when structs are preferred over classes and when not. I’m struggling with that kind of stuff.
Looking back at it now, I’m all for it. I see the possible negative consequences of the old way of doing it.
You can access it, but only from the extended class, not from the base class.
Thanks Mark, I’ll give this a shot later today.
Nope, thanks for investigating this! It’s good to know and understand that some of the ways of working in Max are not valid anymore.
Oh! I found this page on Monkey-X with a post from you Mark about JSON and an example: http://www.monkey-x.com/Community/posts.php?topic=10447
It should be in the bananas folder!
Good luck! The site doesn’t run on Monkey 2 code now does it!?
Thanks!
Thanks. I’ve fixed that. It’s weird, some things in Monkey2 are case sensitive and some are not. Module classes all are case-sensitive, so I think I have them all fixed. Same goes for module constant, also case-sensitive. Lots of keywords are not. So I’m just fixing these little things as I create and read more and more code.
Nice! Gradle is not that bad to set up. You also need the sublime text project files set up in a certain way.
For instance, this is the ST3 project I use for playing around. It has two build systems, one debug and one release. The name parameter is what shows up in ST3, the cmd parameter is the shell command that is executed.
Monkey12345678910111213141516171819202122232425{"folders": [{"path": ".","file_exclude_patterns": [ ".git*", "*.i", "*.sublime-workspace"],"folder_exclude_patterns": [".gradle"]}],"build_systems": [{"name": "Gradle: Build and run BD debug","cmd": "gradle --daemon build_project_debug","working_dir": "${project_path}","shell": "true"},{"name": "Gradle: Build and run BD release","cmd": "gradle --daemon build_project_release","working_dir": "${project_path}","shell": "true"}]}You will also need a file called build.gradle, it must be in the same folder. It defines the tasks referenced in the build systems. PROJECT_NAME must be the same as your main file.
Monkey123456789101112131415161718192021222324252627282930313233343536def PROJECT_NAME = "bd.monkey2"task build_project_debug << {println "Building project DEBUG...\n"def command = "/home/wiebo/Monkey2/bin/mx2cc_linux makeapp -run -clean -target=desktop -config=debug $PROJECT_NAME"print "Running command: '$command'\n"def proc = command.execute()proc.in.eachLine {line -> println line}proc.err.eachLine {line -> println 'ERROR: ' + line}proc.waitFor()def exitValue = proc.exitValue()if (exitValue != 0) {throw new GradleException ("Build project failed with exit code: $exitValue")}}task build_project_release << {println "Building project RELEASE...\n"def command = "/home/wiebo/Monkey2/bin/mx2cc_linux makeapp -run -clean -target=desktop -config=release $PROJECT_NAME"print "Running command: '$command'\n"def proc = command.execute()proc.in.eachLine {line -> println line}proc.err.eachLine {line -> println 'ERROR: ' + line}proc.waitFor()def exitValue = proc.exitValue()if (exitValue != 0) {throw new GradleException ("Build project failed with exit code: $exitValue")}}Good to hear. Let me know of any problems you find, ok?
Hi Pete,
I guess it will be! I’m heavily testing it right now, but i’ve put a copy on google drive if you want to try it. I’m using ST3 btw. Put it in your packages/user folder.
https://drive.google.com/file/d/0B808ULgYyi5FM1FjUlA5MW5uZ2M/view?usp=sharing
Still working on snippets, etc…
This makes sense now. Thanks. The inner workings of Monkey 2 and mojo are most interesting to explore
@Mark: Oh that default style looks interesting. I’ll go dive into the style code. Thanks.
@Danillo: Thanks for the tip about setting the font in the render method. It’s something I can live with!
June 8, 2016 at 6:28 pm in reply to: mx2cc crashing because of print command. Am i doing something stupid or? #984The New() method sets the _instance field.
But don’t look at this code as production code
It’s me fooling around and causing crashes.
Good to see you here, btw, Matthew
June 8, 2016 at 7:06 am in reply to: mx2cc crashing because of print command. Am i doing something stupid or? #971A bug! OK. I was just playing around, trying to see which variations of a singleton I could create.
I think I need a new pull from the repository, because here Exception is still documented as being in monkey module.
June 7, 2016 at 8:03 pm in reply to: mx2cc crashing because of print command. Am i doing something stupid or? #946More info. When I kill the mx2cc process (it is using 100% CPU) , I get this output:
FAILURE: Build failed with an exception.
* Where:
Build file ‘/home/wiebo/Monkey2/mystuff/boulderdash/build.gradle’ line: 16* What went wrong:
Execution failed for task ‘:build_project_debug’.
> Build project failed with exit code: 137* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.BUILD FAILED
-
AuthorPosts