That's a video.
Made for this competition.
You can download game and it's source from here.
No real "magic", or anything like that, but still pretty fast, and a proper game.
⚂ This is the day
That's a video.
How it looks and how it is internally
This example demonstrates how to organize system where some level information is presented as a 2-dimensional array (item data indicating block index), and organize collisions with that.
Could basically say that this is a smaller version of my Terra example. Except simpler, using arrays, and Lite-compatible. As well it does not support truly infinite worlds (has a 32000x32000 limit), but target user is not likely to need that anyway.
Let's just say that art assets for this example are from abstract collection.
Today I've made a simple example for strategy-like unit selection.
That is, selecting units (instances) with mouse, with selection rectangle and selected units being displayed accordingly.
Example is well-commented and should be easy to use.
Principle of work is simple - to detect units that overlap selection rectangle, game should cycle through them, performing collision_rectangle checks. Amount of calculations and code complexity is cut here by local variable usage (if you did not know, local variables 'var' will be available inside of with constructions without any prefixes).
Source code follows,
Continue reading
Above: in-game view. Below: taken screenshot of entire room
Fairly big, fairly maze-y, has some rooms, and takes little time to generate
This is a small update to my 2010 dungeon generator example.
The main change is that it now treats high values of "cut dead end" parameters correctly, no longer placing unconnected rooms even if there's enough space to allow that.
Also there's now a small demo on how to use the resulting data, placing some walls and a player to wander around as.
Update: Also see this post about this approach to dungeon generation.
In some cases, a moment comes when you need to display specific content in a area smaller than itself, thus requiring scrolling.
GameMaker does not support 'clip rectangle' type of command for its reasons, however it is easy to 'clip' area to be drawn by using an 'buffer' surface to draw content in, before drawing that to screen.
Attached example illustrates sample implementation of such.
Most often, content of such would be text. And maybe an image. Or two.
Since images would require a bit more code, example does simple and efficient - long long text is rendered into a surface, which is later drawn into an other 'buffer' surface to display it as part of window on screen.
Also there is a scrollbar, which obviously can be improved, if it needs to serve purposes other than displaying position of 'window'.
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.
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.
While working with GameMaker, you might have noticed that all collision_ functions return only first instance to intersect given collision shape, while in some cases you'd want to get all instances that collide with one.
This set of simple scripts adds such missing functionality...