As you may know, GameMaker Language has a Pascal-like "with" structure:
but it's not exactly like the Pascal version. In GameMaker, it can take an instance:
var bullet = instance_create(x, y, obj_bullet);
with (bullet) direction = 180;
or an object type (and will apply the expression to each instance of it):
with (obj_bullet) instance_destroy();
This can be rather handy under the multiple circumstances.
However, initially the same block can not be applied to multiple values, and that's less handy.
Sometimes you can cheat by applying the expression to a shared "parent" type of objects, but that is not always the case (and can have side effects if there are more object types meeting the condition).
So let's consider your options for applying a piece of code to all instances of several types:
Have you heard of PICO-8? It's a "fantasy console" with little built-in sprite/code/level/sound/music editors and a carefully crafted spec. And (slightly changed) Lua scripting. And a web player export (example). A rather interesting option if you like working with restrictions and/or tiny pixelart.
Long story short, I've made a little Haxe compiler target that generates compact Lua code that runs on PICO-8.
This post covers reasoning, some technical details, and tricks used to accomplish this.
This is a bit of a continuation to my older post on the matter of migrating C-style for-loops from other languages to Haxe, expanding with some new things I've learnt since then.
Similar to some older solutions, this involves a bit of a macros, but both the macros and the results got cleaner.
First, let's look at the "everything is complicated" use case again:
(or see by yourself here)
Someone on forums has asked if there's an example/extension that would allow to display a logo or image alongside with the loading bar in HTML5 module of GameMaker: Studio, and I did just that.
It seems that questions about whether (and if so, to what extent) GameMaker: Studio games can be decompiled are being asked at a constant pace, and yet there are still no resources to clear up these questions. So I've decided to make a small post on the matter.
If you are not familiar with what is this all about: older versions of GameMaker had produced executables that could be reversed into an editable file with a help of a program ("decompiler"). Such unpleasant turn of events was made possible because:
- Game data was more or less just appended to the end of a "runtime" executable
- Source code was inserted into data as text, with code structure and comments intact.
So a program would "read" the appropriate sections of the executable, extract game data, and repack it into an editable file, permitting various acitivities, most of which would violate EULA.
To mention, a lot of Lua-based game engines also suffer from this kind of problem, and it is generally solved by obfuscating source code and altering the executable structure (in GM's case, with a so-called "anti-decompiler") for the "decompiler" to not even be able to extract the obscured game data as easily.
So it's a valid thing to wonder about how much of this still applies to GameMaker: Studio...
Click to launch the HTML5 version of the game
First, take a look at the above link. There's score, 7 tetriminos, slowly growing difficulty - standard things for a Tetris game. The catch? There isn't a single line of code. Nor a single variable. It's all done in GameMaker's "drag & drop" visual scripting.
The story of how this even happened is like so - yesterday was another day when my internet connection disappeared for half of the day without any logical reason whatsoever. As I look at the top of my now-static TweetDeck timeline, and notice this bunch of tweets from Vlambeer's Rami Ismail. While you can generally agree with points outlined, few things could have had better clarification:
Difficulty depends not only on developer's coding skills, but also on the tools used.
For example, making a "space invaders" game in most modern tools with built-in memory management, collisions, and function sets is easy enough, but should you go lower level... storing invader information in an array? Storing and moving around dynamically created player and invader bullets?? Programming trajectories and destructible defenses??? Not as much careless fun as you may have envisioned. Pong may seem suddenly simpler with base requirements of just a bunch of variables and inverting ball x/y velocity for bounces.
Additionally, certain tools are best suited for certain task. For example, it is easy to make a turn-based puzzle game in PuzzleScript (hence the name) due to the way engine is based on "rule" definitions. Making a platformer game in PuzzleScript, however, is a much harder feat. It isn't, by no means, impossible, but requires more planning than it would take with a "platformer-centric" engine.
Game development isn't just about having the right tools/resources/experience, but also actually using them creatively. As such, programming in general is often about finding an approach to the problem that isn't the most blatantly obvious or expected but produces results more efficient in terms of computer of development time.
To not make it all look like a rant or a opinion piece, the rest of this post is about creative use of tools - particularly, making the aforementioned Tetris in GameMaker without a single line of code or variable.
SolidFiles: File hosting without the bullshit.
— company motto. TL;DR: more like, with some bullshit.
For a while now I spend my time correcting old links to my examples hosted on SolidFiles whenever I spot one. Mostly they are on forums or my blog and I can correct them relatively easily. Sometimes I cannot edit them and they just stay like that.
Since it's no fun, and I do get complaints about leftover links somewhere every now and then, I've thought that I may as well make a small post highlighting my concerns.
Let's talk about the process of making pixel fonts for a bit.
At first, it may seem like pixel/bitmap making fonts should be an easy process.
After all, there were lots of pixel fonts back in the day, right?
Although those were primarily raster
FON files, while vast majority of modern programs require you to supply fonts in either TrueType (TTF) or OpenType (OTF) formats, both of which generally imply vector-based representations of glyphs (symbols).
Obviously, drawing a pixel font in a vector editor is as bad of an idea as it sounds.
Fortunately, there's a bunch (more like a couple) of programs specifically made for creating pixel fonts. However, these naturally imply that you will have to [re-]draw your font in the program itself, regardless of whether the program is to your tastes or not.
At this point one may be wondering, why isn't it possible to just draw the font in the pixelart editor of your choice and have it automagically converted into an actual font.
After thinking about this for some time (while trying to find "right-looking" fonts), my patience kind of ran out, and I've decided to make such a thing.
So I've made a program that does just that - you give it an image of your font, note the letters/symbols written in it, and get a code that you can import into BitFontMaker2 to make it into an actual font. It's small, clean, and runs right in the browser. Sounds good to be true? See for yourself:
If you like what I'm doing, you can support me via Patreon (it matters!)
Today I'm proud to announce, that my GameJolt API plugin for Construct 2 has been finally updated to support most of site's functions.
This means that you can now display highscore tables and trophies in your game, access Data Store, and more.
You can get the updated extension and example from the GameJolt page, or read this post for few more details.
Being able to quickly upload a HTML5 game to the web is important.
It's not just a more comfortable format for sharing, but sometimes a requirement, since games created with GameMaker: Studio, Construct 2, Haxe+OpenFL and many other tools may not necessarily fully function when launched locally due to browsers laying restrictions over local file access (meaning that sending a ZIP with game files may not quite work).
While it used to be possible to host HTML5 games on Dropbox for free (or, rather, it still is possible, but only if you have enabled the public folder before the late 2013, else it'll cost you some), you can still host HTML5 games freely on Google Drive.
And this article explains the process of hosting your games on Google Drive in detail.