About Vadym

Thanks for reading!
[dinosaur peeking in from the right] Hey! I now have a newsletter! Come take a look.
You can also follow me on Twitter or Tumblr.

Love2d: Platformer engine


Looks nice enough, right?

In free time of last days I've been developing earlier mentioned thing in Love2d, which is platformer engine.
One provides a simple framework for games that use combination of aligned tiles and dynamic objects.
As well it adds a easily modifiable system to load levels from strings, giving freedom for implementing level editors.

You can download a compiled version here or watch discussion thread on official forum here.

GameMaker: collision versus 3d array


Can be seen as a part of those block-building games

So, today comes with an example of collision between point, box, and line versus a 3d array.

3d array is presented as ds_list (z) with ds_grid's (xy).

Functions include management of this 3d array (creation, destruction, modification - no memory leaks included) and actual functions to check for different collisions.

All of these also include error handling, so attempting to check for collision outside the 'map' will threat area as 'air' (0) and not crash the game.

Also note that no optimization was applied to process of block rendering - you'd likely have to change that if basing game with large level on this example.

Download GMK

GameMaker: alpha mask on isometric tiles

As you might have noticed, process of making nice-looking isometric games can be tricky.
Especially that part when you want your terrain look like actual terrain rather than arrangement of isometric images.
Common approach to this is to use alpha channel mask(s) to smooth edges of tiles.
Here I've made a script that applies such mask to given sprite, handling all additional actions needed.

Continue reading

GameMaker: line between objects

You might have met such situations where you need to find nearest coordinate at object's edge towards a point, or find actual (non-bounding box) distance between objects, or other things of this kind. If so, you may find this example useful.
Used method is relatively simple - first find approximate distance with distance_to_point function, and then 'fix precision' by using a 'while not position_meeting' loop.
This way maximum amount of calculations will be limited to cP * iR + dP, where
cP is time needed to check object for collision against a single point
iR is instance 'radius' (maximum distance from origin to corner of bounding box)
dP is time needed to find distance between object's bounding box and point
So it should be acceptable for many cases of usage. If you need to reduce amount of calculations further, could alter distance decrementation 'rate' in two while loops. Removing while() loops entirely would give rather approximate distance calculation.

Download GMK

Love2d: Simple compilation to executable

While having a look at LÖVE engine, I've noticed that described compilation method under Windows is not quite fast or fun (because of requiring you to open console and type\paste project-specific code). So I've grabbed my semi-existing Batch coding skills and made a better one:
copy /b love.exe+%1 "%~dpn1.exe"
How to use this:
  1. Create a file called 'compile.bat' in the same directory with Love2d runner.
  2. Paste above code into it.
  3. To compile a game, drag it's .love\.zip onto your compile.bat - an executable (compiled game) will appear next to it, named after game's file.
That's it. Couldn't be easier.

GameMaker: resource packs refactored

Image: Those awesome futuristic tiles by Morphosis, now in a single aligned image.

I've always found standard resource packs that can be downloaded from site of YoYoGames, however rarely ever used something from them because it took multiple minutes to simply look through everything in there in attempt to find something matching.
So, decision was made to improve the situation a little bit, at least for myself.

Changes include graphics being sorted into categorized folders nicely, transparent background color in graphics, relevant tilesets being merged into larger images, and more. Overall, if you've ever considered using original pack, you might find this useful as well.

Dropbox SolidFiles

See ReadMe for more information.