It's been 5 years since my "variable references in GameMaker" post and people are still interested in passing variables by reference, so this I'm giving the idea a little refresh with new tools that are now available.
Continue reading
It's been 5 years since my "variable references in GameMaker" post and people are still interested in passing variables by reference, so this I'm giving the idea a little refresh with new tools that are now available.
Continue reading
This is a mini-tutorial and an explanation of an approach that allows you to have fluid sub-pixel movements with pixel-perfect cameras in GameMaker!
Continue reading
Click here to see for yourself.
While looking to do some experiments with device motion data in HTML5, I found that there were no existing demos that would work on iOS 14. So, having spent a few hours figuring it out, I decided to write a tutorial with an up-to-date demo.
Continue reading
With GameMaker Studio 2.3 update out for a bit now and 2.3.1 beta just released, it seems like a great time for a blog post going over the numerous syntactic additions.
This covers the syntax itself, how it works, and what you can do with it.
Also included is a list of breaking changes and how to get around them.
Continue reading
This is a small post about the algorithm I wrote for the recent pixel font tool to establish paths of shapes and holes on the image.
Continue readinglabel hello: select dialog("Hello! What would you like to do?") { option "Count to 5": for (var i = 1; i <= 5; i = i + 1) { wait(1); trace(i + "!"); } return 1; option "Nothing": jump yousure; } label yousure: select dialog("You sure?") { option "Yes": trace("Well then,"); return 0; option "No": jump hello; }
Example of supported syntax
As some might remember, earlier this year I have published a small guide on writing interpreters, which went over the process of implementing a basic interpreter capable of evaluating expressions consisting of numbers, operators, and variables.
This continuation of the guide further expands upon concept, outlining how to support calls, statements, and branching - enough for a small scripting language.
Continue reading
Some things are numbers, some aren't
GameMaker Studio 2.2.2 released few days ago, bringing, among improvements, "GML consistency", which changes how automatic type conversion works in corner cases.
A little less known thing, together with that it also changed how GameMaker's string-to-number conversion function (real) works, having it throw an error if your string is definitely not a number.
A slight inconvenience, given that there is not a function to check if a string is a number before attempting conversion.
But, of course, that can be fixed.
Continue reading
This is a small post on how to conveniently and optimally pack an arbitrary number of incoming script arguments into an array.
Continue reading
After seeing series of increasingly strange uses of "user events" in GameMaker games for object-bound actions, it came to my attention that most people are only vaguely aware of other ways of doing things, so I decided to write a small blog post on the matter.
There are many uses for these - for example, you might want to have a "take X damage" method on your enemy objects so that it can be varied depending on requirements - some enemies might just take damage, some should retaliate on being hit, some might have a fancy damage reduction formula. Being able to comfortably define/redefine methods on per-object-type basis can help a lot.
Continue reading
Sometimes you might want to pass an instance variable by reference rather than by value - to have a script modify instance variable(s) passed to it without having to return them, or have an instance save a reference to variable(s) that it should change on other instance, or doing anything else that would usually imply using pointers.
But it might seem like GameMaker does not support such things... or does it? Well, we'll make it.
Continue reading