Welcome to the Interguild's Video Archive! This is a database of all of the videos that our members have made. While we do not provide a way for you to directly upload videos onto our site, we let users upload them to their own accounts on video sites such as Youtube or Google Video. We then embed the videos onto here so that you can find them all in one place.
Not final, but working boulder physics that cascades in a similar way to vanilla HATPC. That user level at the end was Chaos Theory by jebby... and my game crashed at the end. I don't think it was the game's fault though, I was running it in GameMaker: Studio Runner and that tends to crash randomly regardless of what my game does. It doesn't crash like that in HTML5 (or when compiled for Windows).
There's a function called "scr_cascade_check(i, j)" that checks if the specified position contains a boulder which should cascade:
Notes:
Spoiler:
The internal coordinates I use in many cases, referred to as i and j, require a bit of explanation:
* They correspond to the 32x32 grid of tiles. So to get the pixel coordinates, they need to be multiplied by 32.
* They count from the top left corner.
* They are zero-based (so 0, 0 is the tile in the top left corner of the cave)
* The y coordinate comes first (so 1, 0 is the tile below the tile in the top left corner of the cave)
Then there are also a few arrays that should be explained:
* global.blocks[i, j] stores the numerical ID of the block type at that position. Air is 0, boulders are 17.
* global.tiles[i, j] stores a reference to the tile asset which currently occupies that position. Falling or moving objects have no tile asset, so I often use (global.tiles[i, j] != 0) to test if the object at that position is falling or moving.
* global.block_data[blockID, property] stores several properties of each block type by their blockID. The most commonly used of these properties is 3 - collision type. Also used in this code snippet is 11 - associated object, used to get the object type that should be created when this tile is turned into an object.
Basically, if the position contains a boulder tile or a boulder that's waiting to fall, it checks whether the criteria to cascade are met (boulder below, free space to one side or the other) and defaults to cascading left if both directions are available. Boulders are prevented from cascading into the same spot as other boulders by the making them occupy both positions in global.blocks[i, j] while they are rolling.
Then scr_cascade_check() is called whenever a position would normally get updated (such as when a falling object falls past it).
Does the boulder falling through ground glitch currently work?
It's sort of hard to understand whether what we see in Chaos Theory is what we want. The leftmost culumn for example - why didn't it fall to the right for so long? When you take a treasure, the one above it falls immediately. Why the difference? is there a set of rules for what happens first, and/or an amount of maximal stuff that happen in the same time?
also, is there a priority for left/right/top boulder to fall to the same spot - as per level tut3?
Does the boulder falling through ground glitch currently work?
No, and I'm not currently planning on implementing it.
Quote:
The leftmost culumn for example - why didn't it fall to the right for so long?
I'm not sure what exactly you are referring to. If you're talking about that one vertical tower that didn't cascade, that's due to a glitch (which I still haven't nailed down) where falling boulders can "land" on spikes while still staying in the falling state. I have also changed boulder behavior since then so that boulders which land on other falling boulders will actually cascade, so it doesn't currently form towers that tall, although the original glitch is still there.
Quote:
When you take a treasure, the one above it falls immediately. Why the difference? is there a set of rules for what happens first, and/or an amount of maximal stuff that happen in the same time?
Unlike in the original HATPC, there is no limit to how many operations get processed in one tick. In the original game, Chaos Theory's physics grind to a halt as the queue for falling objects filled up, but in my version, the physics still progresses at normal speed. So grabbing treasures causes the boulders to respond instantaneously - often to deadly effect.
Quote:
also, is there a priority for left/right/top boulder to fall to the same spot - as per level tut3?
What do you mean? In terms of directional biases, a boulder which can cascade in either direction will always choose left, and if two boulders both want to cascade into the same spot, the one on the left will generally win.
Do you mean which of the 3 boulders will go through that spot in the middle first? The order would be left, right, top. Top has to have last priority for the second cascade part in tutorial level 3 to work - all the boulders cascading have to take priority over the treasure falling.