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.
⚂ It is nice to exist, isn't it?
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
Today was spent working with JavaScript and Lua.
For now there's nothing to show for JS side of things, but for Lua there is - I've been working on a library for manipulating Minecraft worlds.
At some point of time people were asking me about how bullets were implemented in love.blast() so I wrote this post.
While the algorithms in the actual [mini]game were slightly more complex than what is described here, the difference is not apparent until you have thousands of bullets.
Continue readingI was playing Minecraft often in past days, and once again have came to thoughts that start from phrase "I wish there was...".
As result, I've got to 'playing around' with source of Zombe's ModPack.
This mod already adds some nice additions for single-player and survival multi-player, and most of my edits turned out to be experimental, or something that only I might see use of.
So, these are...
Looks of gadget on desktop, in according pane, and on it's settings screen.
So I've randomly found out that Windows 7 (and Vista too) gadgets are written in HTML+JS+CSS.
Next thing I did was writing my own gadget. So this comes.
'Time is Ticking' is a minimalistic stopwatch. As such, it's purpose is to allow measuring for how long you were doing (or not doing) specific thing. Can be motivating.
Gadget can be considered optimized (does operation and a redraw once per second when on, is entirely idle when off), features customizable backgrounds with ability to specify your own (navigate to %USERPROFILE%\AppData\Local\Microsoft\Windows Sidebar\Gadgets\TimeIsTicking.gadget\image and add 160x32 PNG images to be able to chose them by-name in settings), and is pretty nice-looking overall.
For best experience it is recommended that you have font Dejavu Sans Mono installed, so digits would display appropriately.
To avoid accidental triggering, pause\restart buttons require double-clicking them to react.
As you may know, there are multiple ways to create a sleep\delay function in C++.
These may appeal more or less to you depending on system and libraries available.
The following short function uses functionality of time.h header, which makes it useful for cases when dos.h is missing and you do not want to include windows.h just for a single function.
void sleep(int ms) { clock_t target = clock() + ms; while (clock() < target) { } }